AnimationState class
Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies multiple animations on top of each other (layering).
See Applying Animations in the Spine Runtimes Guide.
- Available extensions
Constructors
- AnimationState(AnimationStateData data)
-
factory
-
AnimationState.fromPointer(Pointer<
spine_animation_state_wrapper> _ptr)
Properties
- data → AnimationStateData
-
The AnimationStateData to look up mix durations.
no setter
- emptyAnimations ← double
-
Sets an empty animation for every track, discarding any queued animations,
and mixes to it over the specified mix duration.
no getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- listener → AnimationStateListener?
-
Available on AnimationState, provided by the AnimationStateListeners extension
Get the current state listenerno setter - manualTrackEntryDisposal ↔ bool
-
getter/setter pair
-
nativePtr
→ Pointer<
NativeType> -
Get the native pointer for FFI calls
no setter
-
rendererObject
→ Pointer<
Void> ? -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeScale ↔ double
-
Multiplier for the delta time when the animation state is updated, causing
time for all animations and mixes to play slower or faster. Defaults to 1.
getter/setter pair
- tracks → ArrayTrackEntry
-
The list of tracks that have had animations, which may contain null
entries for tracks that currently have no animation.
no setter
Methods
-
addAnimation(
int trackIndex, String animationName, bool loop, double delay) → TrackEntry - Queues an animation by name.
-
addAnimation2(
int trackIndex, Animation animation, bool loop, double delay) → TrackEntry - Adds an animation to be played delay seconds after the current or last queued animation for a track. If the track has no entries, this is equivalent to calling setAnimation.
-
addEmptyAnimation(
int trackIndex, double mixDuration, double delay) → TrackEntry - Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's TrackEntry::getMixDuration(). If the track has no entries, it is equivalent to calling setEmptyAnimation(int, float).
-
apply(
Skeleton skeleton) → bool - Poses the skeleton using the track entry animations. The animation state is not changed, so can be applied to multiple skeletons to pose them identically.
-
clearTrack(
int trackIndex) → void - Removes all animations from the track, leaving skeletons in their current pose.
-
clearTracks(
) → void - Removes all animations from all tracks, leaving skeletons in their current pose.
-
disableQueue(
) → void -
dispose(
) → void -
disposeTrackEntry(
TrackEntry? entry) → void -
enableQueue(
) → void -
getTrack(
int trackIndex) → TrackEntry? - Returns The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAnimation(
int trackIndex, String animationName, bool loop) → TrackEntry - Sets an animation by name.
-
setAnimation2(
int trackIndex, Animation animation, bool loop) → TrackEntry - Sets the current animation for a track, discarding any queued animations.
-
setEmptyAnimation(
int trackIndex, double mixDuration) → TrackEntry - Sets an empty animation for a track, discarding any queued animations, and sets the track entry's TrackEntry::getMixDuration(). An empty animation has no timelines and serves as a placeholder for mixing in or out.
-
setListener(
AnimationStateListener? listener) → void -
Available on AnimationState, provided by the AnimationStateListeners extension
Set a listener for all animation state events -
toString(
) → String -
A string representation of this object.
inherited
-
update(
double delta) → void - Increments each track entry's track time, setting queued animations as current if needed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited