-
Notifications
You must be signed in to change notification settings - Fork 0
Sprite
firstmiddlelast edited this page Aug 27, 2023
·
6 revisions
-
layerCountread-only. Returns the amount of layers in the sprite. -
filenameread-only. Returns the file name of the sprite. -
widthread+write. Returns and sets the width of the sprite. -
heightread+write. Returns and sets the height of the sprite. -
colorModeread-only. Returns the sprite's ColorMode. -
selectionplaceholder. Do not use. -
paletteread-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.
- Argument:
-
commit ()commits the current transaction. -
resize (width, height)resizes the sprite.- Argument:
width, The new width. - Argument:
height, The new height.
- Argument:
-
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.
- Argument:
-
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. RequiresfileNameto be specified.
- Argument:
-
loadPalette (fileName)loads a palette file.- Argument:
fileName, The name of the palette file to load
- Argument: