SpriteMap<T> class
Several Sprites under names of your choosing.
final sheet = SpriteSheet('assets/slime.png', .all(56));
final slime = SpriteMap({
'idle': sheet.animation(row: 0, fps: 16),
'jump': sheet.animation(row: 1, fps: 16),
});
node.play('jump');
A name holds one entry: a row of a sheet, a whole image, any Sprite holding one thing. Entries are numbered in the order the map states them.
T is what entries are named by: an enum, a String, anything with ==.
Constructors
Properties
-
entries
↔ List<
SpriteEntry< T> > -
What this holds, in the order its entries are numbered.
latefinaloverride-getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sprites
→ Map<
T, Sprite< int> > -
What this draws, under the names it draws them by.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → SpriteMap< T> -
Re-resolves this sprite against Ignis.cache.
override
-
resolve(
T key) → SpriteEntry< T> ? -
The entry
keynames, or null where nothing here answers to it.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited