addAnimation2 method

TrackEntry addAnimation2(
  1. int trackIndex,
  2. Animation animation,
  3. bool loop,
  4. double delay,
)

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.

delay Seconds to begin this animation after the start of the previous animation. May be < = 0 to use the animation duration of the previous track minus any mix duration plus the negative delay.

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 addAnimation2(int trackIndex, Animation animation, bool loop, double delay) {
  final result = SpineBindings.bindings
      .spine_animation_state_add_animation_2(_ptr, trackIndex, animation.nativePtr.cast(), loop, delay);
  return TrackEntry.fromPointer(result);
}