Aseprite file format reader/writer

Static methods

@:value({ colorDepth : BPP32 })staticcreate(width:Int, height:Int, colorDepth:ColorDepth = BPP32, ?initialPalette:Array<Int>):Ase

Create a new Ase instance

Parameters:

width

File width

height

File height

colorDepth

(optional, default BPP32) color depth. BPP32, BPP16, BPP8 or INDEXED

initialPalette

(optional) Array of RGBA values for initial palette

staticfromBytes(bytes:Bytes):Ase

Create a new Ase instance by parsing bytes loaded from a file or network

Parameters:

bytes

bytes to parse

staticmain():Void

Variables

read onlycolorDepth:ColorDepth

Read-only color depth of the file

read onlyfileSize:Int

Files size in bytes

read onlyfirstFrame:Frame

@:value([])frames:Array<Frame> = []

height:Int

Sprite height

@:value([])finallayers:Array<Layer> = []

width:Int

Sprite width

Methods

@:value({ duration : 100, copyPrev : false })addFrame(copyPrev:Bool = false, duration:Int = 100):Frame

Add a frame to the sprite

Parameters:

copyPrev

if true will copy all the cel from the previous frame

duration

Duration of the frame in milliseconds

@:value({ editable : true, visible : true })addLayer(?name:String, visible:Bool = true, editable:Bool = true):Ase

Create a new layer

Parameters:

name

(optional) Name for the new layer. If not specified Layer N will be used where N is the amount of currently existing layers + 1

visible

(optional, default true)

editable

(optional, default true)

initPalette(colors:Array<Int>):Void

Initialize the pallet

Parameters:

colors

Array of RGBA color values for the new pallet