The Spine class supports SpineSequence objects, which allow you to chain multiple animation items together with delays, speeds, and callback actions.
SpineSequence Interfaces
SpineSequence
Defines a collection of animation items.
n: The name of the sequence.s: An array of SpineSequenceItem objects.l?: An optional index for the loop target within the sequence.
SpineSequenceItem
A single step in a sequence.
n: The name of the animation to play.mixDuration?: Transition duration for this item.delay?: Fixed delay after the animation starts.delayRandom?: A random delay range applied to the item.speed?: Playback speed for this specific item.actions?: An array of SpineSequenceItemAction to execute.
SpineSequenceItemAction
An action triggered during a sequence.
a: A CallBackPath (string) representing the function to call.t: The time/frame at which the action is triggered.
const mySequence: SpineSequence = {
n: 'attack_combo',
s: [
{
n: 'swing_1',
speed: 1.2,
actions: [{ a: 'myCallbackPath', t: 10 }]
},
{
n: 'swing_2',
delay: 5
}
]
};