FireAtlas class

FireAtlas is a mapping file that can hold several Sprites and SpriteAnimations.

Use getSprite and getAnimation to retrieve mapped assets.

Constructors

FireAtlas({required String id, required double tileWidth, required double tileHeight, required String? imageData})
Creates a FireAtlas instance.
FireAtlas.deserializeBytes(List<int> bytes)
Reads a FireAtlas instance from a byte array.
factory
FireAtlas.deserializeJson(Map<String, dynamic> rawJson)
Reads a FireAtlas instance from a json file.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
id ↔ String
Id of the FireAtlas, mainly used by the Fire Atlas Editor for file identification.
getter/setter pair
image → Image
Returns the atlas image.
no setter
imageData ↔ String?
Stores the asset data once this instance has loaded.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selections ↔ Map<String, BaseSelection>
Holds all the selections of this file.
getter/setter pair
tileHeight ↔ double
The height of the tile.
getter/setter pair
tileWidth ↔ double
The width of the tile.
getter/setter pair

Methods

getAnimation(String selectionId) → SpriteAnimation
Returns a SpriteAnimation with the given selectionId.
getSprite(String selectionId) → Sprite
Returns a Sprite with the given selectionId.
loadImage({bool clearImageData = true, Images? images}) → Future<void>
Loads the atlas image into memory so it can be used, this method is used internally by loadAsset, prefer that method unless there is a very specific use case for it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize({bool encoded = true}) → List<int>
Serializes this instances into a byte array.
toJson() → Map<String, dynamic>
Serializes the mappings on this Atlas in a json format.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

loadAsset(String fileName, {AssetsCache? assets, Images? images, bool encoded = true}) → Future<FireAtlas>
Loads the FireAtlas from an asset.