[solved] Using draw_sprite functions with skeletal Spine animations.

M

mjmilson

Guest
Is it possible to use draw_sprite_*() functions with skeletal animations imported from Spine? When attempting to use draw_sprite() it will draw the correct sprite, but will only ever play the first animation from the imported json spine file. Even after setting a new skeleton animation through code it will only play that first animation, even though printing out the result of skeleton_animation_get() shows that it's now correctly on the newly set animation.

So far the only function that works properly is draw_self(), which doesn't allow me to change the x/y values as I want.

My goal is to be able to change the draw location of the sprite compared to its actual position in the room. This is important to simulate jumping in a brawler style game without actually changing the sprite's Y position.

I can probably do this with the draw_skeletan() function but the manual seems to state that this should be avoided at all costs for performance reasons.

The yoyo tech blog for skeletal animations seems to suggest that these draw_sprite functions should work.

Any help is greatly appreciated. Thanks!
 
M

mjmilson

Guest
Debugged further and realized this is an issue with skeletal Animation events not being run automatically if I call my draw event using the event_perform function from another object -- if I'm drawing the sprite using any of the draw_sprite_* functions instead of draw_self(). These functions work correctly if I have my draw event run normally rather than using event_perform to trigger it.

This is outlined in the manual under the Animation events as: This event is triggered in an object which has a skeletal animation sprite assigned to it, and where the object is using the default draw for the assigned sprite, or the sprite is being drawn via draw_self().

I've submitted a support ticket to request this functionality be updated.
 
Top