skeleton_animation_get_position

This function will return the position of the animation on the specified animation track as a value ranging from 0 to 1. This way you can get the track position as a percentage where the value 0 corresponds to 0% and the value 1 to 100%.

It will return -1 if no animation is assigned to the specific track given or if the instance has no sprite set.

 

Syntax:

skeleton_animation_get_position(track);

ArgumentTypeDescription
trackRealThe animation track to get the position of.

 

Returns:

Real

 

Example:

var _position = skeleton_animation_get_position(0);
var _position_percent = _position * 100;
show_debug_message("The skeleton animation position on track 0 is at " + string(_position_percent) + "%.");

The above code checks the current position of the skeleton animation assigned to track 0 and stores it in a temporary variable _position. It then converts that value to a percentage by multiplying it by 100 and stores the result of that in another temporary variable _position_percent.
Finally it shows a debug message that displays the percent value.