setAnimation2 method
Sets the current animation for a track, discarding any queued animations.
If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed from).
loop If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration. In either case TrackEntry.TrackEnd determines when the track is cleared.
Returns A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
Implementation
TrackEntry setAnimation2(int trackIndex, Animation animation, bool loop) {
final result = SpineBindings.bindings
.spine_animation_state_set_animation_2(_ptr, trackIndex, animation.nativePtr.cast(), loop);
return TrackEntry.fromPointer(result);
}