AsepriteData
Data structure containing parsed Aseprite file information.
This class holds all the data extracted from an Aseprite (.ase/.aseprite) file, including frames, layers, tags, slices, and palette information. It manages the texture atlas used to pack frame images and optionally creates sprite sheets for animation playback.
The data is typically created by AsepriteParser and can be used to:
- Access individual frames and their pixel data
- Create animated sprites using tags
- Extract slice information for UI elements
- Access layer data for compositing
Instance Members
The raw Aseprite format file data. Contains low-level file structure information from the ase library.
The color palette extracted from the Aseprite file. For indexed color mode sprites, this defines the available colors. For RGB mode sprites, this may be null or unused.
Animation tags defined in the Aseprite file. Tags mark frame ranges that can be played as animations. Keys are tag names, values contain frame range and loop information.
Slices defined in the Aseprite file. Slices mark rectangular regions that can be used for 9-slice scaling or to define UI element boundaries. Keys are slice names, values contain bounds and pivot data.
Layer information from the Aseprite file. Layers are composited together to create the final frames. Array is ordered from bottom to top layer.
Total duration of the complete animation in seconds. This is the sum of all frame durations in the sprite.
Prefix used for naming texture regions in the atlas. Frame regions are named as "prefix#frameNumber". This allows multiple Aseprite files to share the same atlas.
All frames extracted from the Aseprite file. Each frame contains the composited image data and timing information. Frames are ordered by frame number (0-based).
The texture atlas packer used to pack frame images. This optimally arranges all frames into texture pages to minimize texture switches during rendering. May be null if frames are not packed into an atlas.
The texture atlas containing all packed frames. This is a convenience accessor for atlasPacker.atlas. Returns null if frames are not packed into an atlas.
The image asset that loaded this Aseprite data. Kept for reference counting and automatic cleanup. May be null if data was created programmatically.
new(ase: ase.Ase, palette: AsepritePalette, tags: Map, slices: Map, layers: Array<ase.chunks.LayerChunk>, duration: Float, frames: Array<AsepriteFrame>, prefix: String, ?atlasPacker: TextureAtlasPacker): VoidCreates a new AsepriteData instance holding the parsed content of an Aseprite file.
An explicit constructor (rather than @:structInit) so that the entity
constructor arguments, such as the debug allocation position, are forwarded properly.
| Name | Type | Default | Description |
|---|---|---|---|
ase |
ase.Ase | The raw Aseprite format file data | |
palette |
AsepritePalette | The color palette extracted from the file | |
tags |
Map | Animation tags defined in the file | |
slices |
Map | Slices defined in the file | |
layers |
Array<ase.chunks.LayerChunk> | Layer information from the file | |
duration |
Float | Total duration of the complete animation in seconds | |
frames |
Array<AsepriteFrame> | All frames extracted from the file | |
prefix |
String | Prefix used for naming texture regions in the atlas | |
atlasPacker |
TextureAtlasPacker | (optional) | The texture atlas packer used to pack frame images (optional) |
The sprite sheet created from the Aseprite frames. This provides animation playback functionality when the sprite plugin is enabled. Automatically destroyed when the AsepriteData is destroyed.
The sprite asset that loaded this Aseprite data. Used when the Aseprite file is loaded as a sprite asset. Kept for reference counting and automatic cleanup.
Private Members
Destroys the sprite sheet if it exists. Ensures the atlas reference is cleared before destruction to prevent double-freeing of texture resources.
Metadata
| Name | Parameters |
|---|---|
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |