Difference between playing animations by gui and by spine

Hi everybody! :slight_smile:
I’m new at Defold and already have a little question. I have a gui of window with many nodes and one f them is spine. What’s the difference between playing this spine with gui.play_spine_animation() and spine.play_anim()?
Thanks!

If I recall correctly, we use gui.play_spine_animation() for nodes in the gui. You have spine.scene, which is added to the gui and there is a spine node inside the gui.

spine.play_anim is used outside gui. For example you have collection with go object which has spine object inside.

I assume that both functions are identical and the animation will be played the same.

3 Likes

Thank you for answer! :slight_smile:
So If I understand correctly, spine.play_anim() can play animation from another collection? Cause I remember when my colleagues told me add spine node inside current collection (spine was inside other collection), because there are different “namespaces” and animation wouldn’t play…

It really does not matter from where to call spine.play_anim(). You just need to put correct url.

2 Likes

Yes, this function is used when you need to play a spine animation on a spine model component on a game object.

The other function is used when playing spine animations in the context of a GUI scene.

2 Likes

Thank you, guys! It’s really become clearer :slight_smile:

2 Likes