setAnimation method

TrackEntry setAnimation(
  1. int trackIndex,
  2. Animation animation,
  3. bool loop
)

Implementation

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