Skip to content
firstmiddlelast edited this page Aug 27, 2023 · 6 revisions
  • layerCount read-only. Returns the amount of layers in the sprite.

  • filename read-only. Returns the file name of the sprite.

  • width read+write. Returns and sets the width of the sprite.

  • height read+write. Returns and sets the height of the sprite.

  • colorMode read-only. Returns the sprite's ColorMode.

  • selection placeholder. Do not use.

  • palette read-only. Returns the sprite's palette.

  • layer (layerNumber) allows you to access a given layer.

    • Argument: layerNumber, The number of they layer, starting with zero from the bottom.
    • Returns: a Layer object or null if invalid.
  • commit () commits the current transaction.

  • resize (width, height) resizes the sprite.

    • Argument: width, The new width.
    • Argument: height, The new height.
  • crop (x, y, width, height) crops the sprite to the specified dimensions.

    • Argument: x, The left-most edge of the crop.
    • Argument: y, The top-most edge of the crop.
    • Argument: width, The width of the cropped area.
    • Argument: height, The height of the cropped area.
  • save () saves the sprite.

  • saveAs (fileName, asCopy) saves the sprite.

    • Argument: fileName, String. The new name of the file
    • Argument: asCopy, If true, the file is saved as a copy. Requires fileName to be specified.
  • loadPalette (fileName) loads a palette file.

    • Argument: fileName, The name of the palette file to load

Clone this wiki locally