TilesetImage
Entity → tracker.Model → ceramic.TilesetImage (Class)
Represents the image resource used by a tileset.
TilesetImage encapsulates the texture and metadata for a tileset's graphical data. It manages the texture lifecycle, including asset retention and hot-reloading support. The image dimensions can be specified explicitly or derived from the loaded texture.
Features
- Texture Management: Handles texture loading and lifecycle
- Asset Retention: Properly retains/releases texture assets
- Hot-Reload Support: Automatically updates when texture assets are replaced
- Dimension Tracking: Stores image dimensions for layout calculations
Usage Example
var image = new TilesetImage();
image.source = "tiles/terrain.png";
image.texture = assets.texture("tiles/terrain");
// Dimensions are automatically set from texture if not specified
trace('Image size: ${image.width}x${image.height}');
// Attach to a tileset
tileset.image = image;
Instance Members
The texture used for this image, if loaded and ready to display
The image width in points
The image height in points
The reference to the tileset image file, if any
Private Members
Event when width field changes.
Name | Type |
---|---|
current |
Int |
previous |
Int |
Event when height field changes.
Name | Type |
---|---|
current |
Int |
previous |
Int |
Event when source field changes.
Name | Type |
---|---|
current |
String |
previous |
String |
Internal callback for texture hot-reloading. Called when the texture asset is replaced at runtime.
Name | Type | Description |
---|---|---|
newTexture |
Texture | The new texture instance |
prevTexture |
Texture | The previous texture being replaced |
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
tracker.macros.SerializableMacro.build() |
:autoBuild |
tracker.macros.SerializableMacro.build() |