AsepriteFrame
Represents a single frame from an Aseprite animation.
Each frame contains the composited image data from all visible layers, timing information, and metadata about which animation tags include this frame. Frames may be deduplicated if they have identical pixel data to save memory.
The frame's pixel data is stored as RGBA bytes and can be packed into a texture atlas for efficient rendering.
Instance Members
The underlying frame data from the ase library. Contains raw frame information from the file format.
The frame index (0-based) in the animation sequence.
Duration of this frame in seconds. Determines how long this frame is displayed during animation playback.
Names of animation tags that include this frame. A frame can belong to multiple overlapping tags.
The pixel data for this frame in RGBA format. Each pixel uses 4 bytes (R, G, B, A) with values 0-255. May be null if this frame is a duplicate of another frame.
Hash of the pixel data used for duplicate detection. Frames with identical hashes can share the same texture region.
Index used for grouping frames with identical hashes. Frames with the same hashIndex have identical pixel data.
If this frame is a duplicate, the index of the original frame. -1 if this frame is not a duplicate.
Whether this duplicate frame has the same offset as the original. If true, the frames can share the exact same texture region.
Horizontal offset for trimmed frames. When frames are trimmed of transparent pixels, this indicates where to position the trimmed image relative to the canvas.
Vertical offset for trimmed frames. When frames are trimmed of transparent pixels, this indicates where to position the trimmed image relative to the canvas.
Width of the frame after trimming transparent pixels. This is the actual width stored in the texture atlas.
Height of the frame after trimming transparent pixels. This is the actual height stored in the texture atlas.
new(aseFrame: ase.Frame, index: Int, duration: Float, ?tags: Null<Array<String>>, ?pixels: Null<UInt8Array>, ?hash: Null<haxe.io.Bytes>, ?hashIndex: Null<Int>, ?duplicateOfIndex: Null<Int>, ?duplicateSameOffset: Null<Bool>, ?offsetX: Null<Int>, ?offsetY: Null<Int>, ?packedWidth: Null<Int>, ?packedHeight: Null<Int>): Void
Name | Type | Default | Description |
---|---|---|---|
aseFrame |
ase.Frame | * The underlying frame data from the ase library. Contains raw frame information from the file format. | |
index |
Int | * The frame index (0-based) in the animation sequence. | |
duration |
Float | * Duration of this frame in seconds. Determines how long this frame is displayed during animation playback. | |
tags |
Null<Array<String>> | (optional) | * Names of animation tags that include this frame. A frame can belong to multiple overlapping tags. |
pixels |
Null<UInt8Array> | (optional) | * The pixel data for this frame in RGBA format. Each pixel uses 4 bytes (R, G, B, A) with values 0-255. May be null if this frame is a duplicate of another frame. |
hash |
Null<haxe.io.Bytes> | (optional) | * Hash of the pixel data used for duplicate detection. Frames with identical hashes can share the same texture region. |
hashIndex |
Null<Int> | (optional) | * Index used for grouping frames with identical hashes. Frames with the same hashIndex have identical pixel data. |
duplicateOfIndex |
Null<Int> | (optional) | * If this frame is a duplicate, the index of the original frame. -1 if this frame is not a duplicate. |
duplicateSameOffset |
Null<Bool> | (optional) | * Whether this duplicate frame has the same offset as the original. If true, the frames can share the exact same texture region. |
offsetX |
Null<Int> | (optional) | * Horizontal offset for trimmed frames. When frames are trimmed of transparent pixels, this indicates where to position the trimmed image relative to the canvas. |
offsetY |
Null<Int> | (optional) | * Vertical offset for trimmed frames. When frames are trimmed of transparent pixels, this indicates where to position the trimmed image relative to the canvas. |
packedWidth |
Null<Int> | (optional) | * Width of the frame after trimming transparent pixels. This is the actual width stored in the texture atlas. |
packedHeight |
Null<Int> | (optional) | * Height of the frame after trimming transparent pixels. This is the actual height stored in the texture atlas. |
Metadata
Name | Parameters |
---|---|
:structInit |
- |