SpriteAnimation class

A run of frames, played.

The plain constructor is for art that ships one file per animation:

final idle = SpriteAnimation('assets/slime_idle.png', .all(56), fps: 16);

This kind of sprite is frequently obtained via SpriteSheet.animation, which can cut up a single image into any number of animations.

Inheritance

Constructors

SpriteAnimation(String asset, Vector2 size, {int? row, int? start, int? end, required double fps, bool? loop})
Cuts the image cached at asset into size frames and plays them.
factory
SpriteAnimation.of(SpriteRegion region, {required double fps, bool? loop})
Plays region at fps, holding every frame for the same length of time.
factory
SpriteAnimation.timed(String asset, Vector2 size, List<double> durations, {int? row, int? start, bool? loop})
Cuts the image cached at asset into size frames, each held for its own number of seconds.
factory
SpriteAnimation.timedOf(SpriteRegion region, List<double> durations, {bool? loop})
Plays region, holding each frame for its own number of seconds.
factory

Properties

entries → List<SpriteEntry<int>>
What this holds, in the order its entries are numbered.
final
hashCode → int
The hash code for this object.
no setterinherited
region → SpriteRegion
Which piece of which asset this plays.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() → Sprite<int>
Re-resolves this sprite against Ignis.cache.
override
resolve(int key) → SpriteEntry<int>?
The entry key names, 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