ConvertSpriteSheet
ceramic.ConvertSpriteSheet (Class)
Implements: ConvertField
Field converter for SpriteSheet instances. Handles conversion between asset names (strings) and loaded SpriteSheet objects. This enables automatic sprite sheet loading when deserializing entities.
Used by the entity serialization system to convert sprite sheet references in saved data into actual SpriteSheet instances.
Instance Members
sprite
basicToField(instance: Entity, field: String, assets: Assets, basic: String, done: Function): Void
Convert a sprite sheet asset name to a loaded SpriteSheet instance.
Name | Type | Description |
---|---|---|
instance |
Entity | The entity that owns this field |
field |
String | The name of the field being converted |
assets |
Assets | The assets instance to load from |
basic |
String | The sprite sheet asset name |
done |
Function | Callback with the loaded SpriteSheet (or null if loading fails) |
Convert a SpriteSheet instance back to its asset name for serialization.
Name | Type | Description |
---|---|---|
instance |
Entity | The entity that owns this field |
field |
String | The name of the field being converted |
value |
SpriteSheet | The SpriteSheet instance |
Returns | Description |
---|---|
String | The asset name, or null if the sheet has no associated asset |