Ase

ase.Ase (Class)

Aseprite file format reader/writer

Static Members

create(width: Int, height: Int, ?colorDepth: ase.types.ColorDepth = BPP32, ?initialPalette: Array<Int>): Ase

Create a new Ase instance

Name Type Default Description
width Int File width
height Int File height
colorDepth ase.types.ColorDepth BPP32 (optional, default BPP32) color depth. BPP32, BPP16, BPP8 or INDEXED
initialPalette Array<Int> (optional) (optional) Array of RGBA values for initial palette
Returns
Ase

fromBytes(bytes: haxe.io.Bytes): Ase

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

Name Type Description
bytes haxe.io.Bytes bytes to parse
Returns
Ase

main(): Void

Instance Members


frames: Array<Frame>

Read-only color depth of the file


fileSize: Int

Files size in bytes


firstFrame: Frame

width: Int

Sprite width


height: Int

Sprite height


palette: Palette

layers: Array<Layer>

initPalette(colors: Array<Int>): Void

Initialize the pallet

Name Type Description
colors Array<Int> Array of RGBA color values for the new pallet

addFrame(?copyPrev: Bool = false, ?duration: Int = 100): Frame

Add a frame to the sprite

Name Type Default Description
copyPrev Bool false if true will copy all the cel from the previous frame
duration Int 100 Duration of the frame in milliseconds
Returns
Frame

addLayer(?name: String, ?visible: Bool = true, ?editable: Bool = true): Ase

Create a new layer

Name Type Default Description
name String (optional) (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 Bool true (optional, default true)
editable Bool true (optional, default true)
Returns
Ase

Converts Aseprite data to binary data that can be stored to a file

Name Type Default
out haxe.io.BytesOutput (optional)
Returns
haxe.io.Bytes

toString(): String
Returns
String

Private Members

createHeader(): Void

https://github.com/aseprite/aseprite/blob/10dda30a15a58d09e561a59594f348b4db3a4405/docs/ase-file-specs.md#old-palette-chunk-0x0004

Aseprite v1.1 saves both chunks (0x0004 and 0x2019) just for backward compatibility. Aseprite v1.3.5 writes this chunk if the palette doesn't have alpha channel and contains 256 colors or less (because this chunk is smaller), in other case the new palette chunk (0x2019) will be used (and the old one is not saved anymore).


createFirstFrame(): Void

createLayers(): Void

Create layers after ase chunks are loaded


new(): Void

Metadata

Name Parameters
:expose "Ase"