Sprite<T> class
abstract
The frames a SpriteNode draws, and how long each is held.
Three implementations ship: a SpriteImage is one image, a SpriteSheet cuts an image into a grid, and a SpriteGroup lays several of either end to end. Implement this to draw frames packed some other way.
A row is the unit. Everything but rows answers for one, so an implementation is free to hold every row in its own image, at its own size.
T is what rows are named with, where they are named at all: an enum, a
String, anything with an ==. Every sprite composed with another shares
its key type, so rowOf answers for the whole tree.
- Implementers
Constructors
- Sprite()
-
const
Properties
Methods
-
duration(
int row, int index) → double -
How long frame
indexofrowis held, in seconds. -
frames(
int row) → int -
How many frames
rowplays. -
image(
int row) → Image -
The image
rowis drawn from. -
loops(
int row) → bool -
Whether
rowstarts over after its last frame. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rect(
int row, int index) → Rect -
Where frame
indexofrowsits in image. -
reload(
) → Sprite< T> - Re-resolves this sprite against Ignis.cache.
-
rowOf(
T key) → int? -
The row
keynames, or null where nothing here answers to it. -
size(
int row) → Vector2 -
The size of one frame of
row, which a SpriteNode takes as its own. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited