apply method

void apply(
  1. Skeleton skeleton,
  2. double lastTime,
  3. double time,
  4. bool loop,
  5. ArrayEvent? events,
  6. double alpha,
  7. MixBlend blend,
  8. MixDirection direction,
  9. bool appliedPose,
)

Applies the animation's timelines to the specified skeleton.

See Timeline::apply().

skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton components the timelines may change. lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered. time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the getDuration() and loop is true then the animation will repeat, else the last frame will be applied. loop If true, the animation repeats after the getDuration(). events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines fire events. alpha 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering). blend Controls how mixing is applied when alpha < 1. direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.

Implementation

void apply(Skeleton skeleton, double lastTime, double time, bool loop, ArrayEvent? events, double alpha,
    MixBlend blend, MixDirection direction, bool appliedPose) {
  SpineBindings.bindings.spine_animation_apply(_ptr, skeleton.nativePtr.cast(), lastTime, time, loop,
      events?.nativePtr.cast() ?? Pointer.fromAddress(0), alpha, blend.value, direction.value, appliedPose);
}