Draws the skeletal animation sprite at a specific time-frame.


GML Code Example

draw_skeleton_time(sprite, animname, skinname, time, x, y, xscale, yscale, rot, colour)

Argument Description
sprite The index of the sprite to draw.
animname The name of the animation to get the frame from (a string).
skinname The name of the skin to use for drawing (a string).
time The time-frame to draw the animation at (from 0 to the end duration, in seconds).
x The x coordinate of where to draw the sprite.
y The y coordinate of where to draw the sprite.
xscale The horizontal scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc...
yscale The vertical scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc...
rot The rotation of the sprite. 0=normal, 90=turned 90 degrees counter-clockwise etc.
colour The colour with which to blend the sprite.

Returns: N/A


This function will draw the given animation using the given skin at a specific time in the animation. The time value should be between 0 (the beginning) and the end duration of the animation, which you can find using the function skeleton_animation_get_duration(). You can set the time value to values higher than the total duration of the animation and the animation will loop back to the beginning, but you run the risk of losing floating point accuracy as the accumulated time gets larger.

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


GML Code Example

var time += delta_time / 1000000;
 var d = skeleton_animation_get_duration("walk");
 if time > d time -= d;
 draw_skeleton_time(sprite_index, "walk", "skin1", time, x, y, image_xscale, image_yscale, image_angle, c_white);

The above code will draw the given skeletal animation sprite using delta-time to set the frame being drawn.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here