addAnimation method

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

Implementation

TrackEntry addAnimation(int trackIndex, Animation animation, bool loop, double delay) {
  final entry =
      _bindings.spine_animation_state_add_animation(_state, trackIndex, animation._animation, loop ? -1 : 0, delay);
  if (entry.address == nullptr.address) throw Exception("Couldn't add animation ${animation.getName()}");
  return TrackEntry._(entry, this);
}