SpriteAnimationTicker class

A helper class to make the spriteAnimation tick.

Constructors

SpriteAnimationTicker(SpriteAnimation spriteAnimation)

Properties

clock double
Current clock time (total time) of this animation, in seconds, since last frame.
getter/setter pair
completeCompleter Completer<void>?
getter/setter pair
completed Future<void>
A future that will complete when the animation completes.
no setter
currentFrame SpriteAnimationFrame
The current frame that should be displayed.
no setter
currentIndex int
Index of the current frame that should be displayed.
getter/setter pair
elapsed double
Total elapsed time of this animation, in seconds, since start or a reset.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isFirstFrame bool
Returns whether the animation is on the first frame.
no setter
isLastFrame bool
Returns whether the animation is on the last frame.
no setter
isPaused bool
Returns current value of paused flag.
no setter
isSingleFrame bool
Returns whether the animation has only a single frame (and is, thus, a still image).
no setter
onComplete ↔ void Function()?
Registered method to be triggered when the animation complete.
getter/setter pair
onFrame ↔ void Function(int currentIndex)?
Registered method to be triggered when the animation frame updates.
getter/setter pair
onStart ↔ void Function()?
Registered method to be triggered when the animation starts.
getter/setter pair
paused bool
Sets the given value of paused flag.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spriteAnimation SpriteAnimation
final

Methods

done() bool
getSprite() Sprite
Gets the current Sprite that should be shown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the animation, like it would just have been created.
setToLast() → void
Sets this animation to be on the last frame.
toString() String
A string representation of this object.
inherited
totalDuration() double
Computes the total duration of this animation (before it's done or repeats).
update(double dt) → void
Updates this animation, if not paused, ticking the lifeTime by an amount dt (in seconds).

Operators

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