skeleton:setAnimation()¶
Type:
functionSee also: skeleton.index
Overview:¶
Immediately sets an animation on a given track, overwriting any existing animation on that track.
Syntax:¶
skeleton:setAnimation(trackIndex, animationName, loop)
Parameters:¶
trackIndex (number) – 1-based track index.
animationName (string) – The name of the animation to set.
loop (boolean) – true to loop, false otherwise.
Example:¶
hero:setAnimation(1, "run", true)