skeleton_animation_get_frame

Returns the frame number of the animation on the specified track

Syntax:

skeleton_animation_get_frame(track);


Argument Description
track The animation track to get the frame of.


Returns: Integer


Description

This function will return the frame number of the animation on the specified animation track. The function will return -1 if no animation is assigned to the specific track given.

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


Example:

var frame = skeleton_animation_get_frame(0);
if frame > 0 && frame < 2
    {
    var box = skeleton_get_minmax();
    var ww = (box[2] - box[0]) / 2;
    var hh = (box[3] - box[1]) / 2;
    part_particles_create(global.p_sys, box[0] + ww, box[1] + hh, global.Stars, 10);
    }

The above code will check the current frame of the animation assigned to track 0 and then burst some particles from a point in the middle of the total bounding box for the sprite.


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