slothwerks

I'm interested in using Spine to animate a UI. Basically, I need the animation data, but I don't care about any images/atlases/etc... I want to create the animation in Spine, but then apply the animation to the GameObjects that compose my UI in Unity. In a perfect world, I'd take a Spine animation and then connect different object names (defined in Spine) to apply to a GameObject in my scene. The GameObjects may be things like text boxes, radio buttons, etc... so its' not possible to just render them as images.

So far, I understand there are something called 'Slots', but not sure if this is appropriate - this seemed like it was used more for attachments (eg: a sword in the character's hand)

I also found this thread from a few years ago which I think roughly describes the process, though I'm too new to Spine to follow the suggestion as described http://esotericsoftware.com/forum/Is-there-a-way-to-load-an-animation-without-atlas-4066

If there are existing examples which demonstrate applying Spine animations to an arbitrary GameObject hierarchy, let me know!

EDIT: I also found this post: http://esotericsoftware.com/forum/Spine-for-User-Interface-animation-7250

"At runtime you may want to position UI elements, like buttons, text boxes, and select boxes. Since those don't exist in Spine, you could use placeholder images. At runtime you wouldn't need the images. You would just apply the animations and use the bone world transforms to position, rotate, and scale your UI elements."

Are there any examples that demonstrate how to apply these animations to a GameObject?
slothwerks
Posts: 2

Pharan

Currently, no, there are no examples of animated UI in Spine per se. But your use case sounds like something you can wire together yourself with what's already possible.

If you've downloaded the latest Spine-Unity unitypackage, there's a sample scene there that demonstrates SkeletonGraphic, the Spine UI component.

In that sample scene, there are also UI.Text RectTransforms that are being made to follow specific bones on a skeleton. So when the skeleton's bones move around, the transforms move around with them (move position and rotation).

Using those SkeletonGraphic and BoneFollowerGraphic components can likely be used to achieve what you're imagining on the Unity side.

Imgur
User avatar
Pharan

Pharan
Posts: 4427


Return to Unity