SpriteEntry<T> class final

One entry of a Sprite: the frames it draws, and how it plays them.

Frames are cut once, here, rather than on every draw.

Constructors

SpriteEntry({required int index, required T key, required Image image, required Vector2 size, required bool loops, required List<Rect> rects, required List<double> durations})

Properties

frames → int
How many frames this plays.
no setter
hashCode → int
The hash code for this object.
no setterinherited
image → Image
The image this is drawn from.
final
index → int
Where this sits in the sprite that holds it.
final
key → T
What this answers to.
final
loops → bool
Whether this starts over after its last frame.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → Vector2
The size of one frame, which a sprite node takes as its shape.
final

Methods

duration(int frame) → double
How long frame is held, in seconds.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rect(int frame) → Rect
Where frame sits in image.
rename<U>(int index, U key) → SpriteEntry<U>
The same entry, sitting at index and answering to key instead.
toString() → String
A string representation of this object.
override

Operators

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