skeleton_animation_set_frame

Sets an animation frame for the given track.

Syntax:

skeleton_animation_set_frame(track, index);


Argument Description
track The animation track to set the frame of.
index The new index for the animation frame.


Returns: N/A


Description

This function will set the animation assigned to the given track to the frame you supply. The frame index should be an real value between 0 and the number of frames for the animation (which you can get using the function skeleton_animation_get_frames). If you supply a value outside of this range, the animation will be looped to make up the difference, for example if the animation has 5 frames and you set the frame to 8, the actual frame shown will be 3.

IMPORTANT: Spine integration in GameMaker: Studio is a Pro licence feature and will not work in the Free/Standard versions.


Example:

if global.pause
    {
    skeleton_animation_set_frame(0, -image_speed);
    }

The above code will set the frame index for the animation in track 0 to the negative image speed when the global "pause" variable is true (essentially pausing the animation).


Back: Skeletal Animations
Next: skeleton_get_minmax
© Copyright YoYo Games Ltd. 2018 All Rights Reserved