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.
Destroys this AsepriteData and all associated resources. This includes:
- The sprite sheet (if sprite plugin is enabled)
- Texture regions in the atlas
- Associated sprite and image assets
new(ase: ase.Ase, palette: AsepritePalette, tags: Map, slices: Map, layers: Array<ase.chunks.LayerChunk>, duration: Float, prefix: String, frames: Array<AsepriteFrame>, ?atlasPacker: Null<TextureAtlasPacker>, ?imageAsset: Null<ImageAsset>, ?sheet: Null<SpriteSheet>, ?spriteAsset: Null<SpriteAsset>): Void
Name | Type | Default | Description |
---|---|---|---|
ase |
ase.Ase | * The raw Aseprite format file data. Contains low-level file structure information from the ase library. Create a new entity. | |
palette |
AsepritePalette | * 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. | |
tags |
Map | * 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 |
Map | * 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. | |
layers |
Array<ase.chunks.LayerChunk> | * Layer information from the Aseprite file. Layers are composited together to create the final frames. Array is ordered from bottom to top layer. | |
duration |
Float | * Total duration of the complete animation in seconds. This is the sum of all frame durations in the sprite. | |
prefix |
String | * 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. | |
frames |
Array<AsepriteFrame> | * 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). | |
atlasPacker |
Null<TextureAtlasPacker> | (optional) | * 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. |
imageAsset |
Null<ImageAsset> | (optional) | * The image asset that loaded this Aseprite data. Kept for reference counting and automatic cleanup. May be null if data was created programmatically. |
sheet |
Null<SpriteSheet> | (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. |
spriteAsset |
Null<SpriteAsset> | (optional) | * 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. |
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() |
:structInit |
- |