Spine: 2D skeletal animation

ok… thank you… actually no solutions… i will tinker my code and make, calculate the width and the height according to the bones positions and scale… i will reflect…

For now there isn’t a true way although it is planned on being added. Nate said as a substitute until then:

[quote]For now you could use a transparent image in Spine, then at runtime don’t draw this image. Instead, use its vertices to do hit detection.
[/quote]
Watch the progress of it here:
https://trello.com/card/bounding-boxes/5131e9578f174c521c0059d9/39

ok… thank you… actually no solutions… i will tinker my code and make, calculate the width and the height according to the bones positions and scale… i will reflect…

Here’s Java code to do it:
http://www.esotericsoftware.com/forum/viewtopic.php?f=3&t=34&p=147#p147
It’s slightly outdated, but that is how it can be done. :slight_smile: Note with an animated skeleton you might want to compute this every frame.

Here’s Java code to do it:
http://www.esotericsoftware.com/forum/viewtopic.php?f=3&t=34&p=147#p147
It’s slightly outdated, but that is how it can be done. :slight_smile: Note with an animated skeleton you might want to compute this every frame.

Aaaaa thank you Nate, i’m just seeing your answer. :slight_smile:

Aaaaa thank you Nate, i’m just seeing your answer. :slight_smile:

Okay Nate! It works! My spine animation resize to the area choosen. I can increase or decrease the area zone. It’s very fun :slight_smile:

Thank you again!

Okay Nate! It works! My spine animation resize to the area choosen. I can increase or decrease the area zone. It’s very fun :slight_smile:

Thank you again!

Cool! :slight_smile: You can also attach an image in Spine that you avoid drawing at runtime. You can then get the vertices of this image at runtime. Note it can be a quadrilateral (rhomboid), so you can use polygon intersection testing. This is better than just a bounding box, as it will move, rotate, and scale with the bone it is attached to. This is essentially what the bounding box feature will do.

Cool! :slight_smile: You can also attach an image in Spine that you avoid drawing at runtime. You can then get the vertices of this image at runtime. Note it can be a quadrilateral (rhomboid), so you can use polygon intersection testing. This is better than just a bounding box, as it will move, rotate, and scale with the bone it is attached to. This is essentially what the bounding box feature will do.

O I had just needed the started bounding box. It’s okay :slight_smile:

Now i have a new problem, how i can change the originX and originY for rotation and rescale? Because the origin for the rotation is at animation’s bottom center and the origin for the rescale is at animation’s bottom left. I would the origin be at animations’s top left.
What are the possibles solution to make it?

The origin is a runtime specific thing. You can move the root bone so the top left is at the origin, then when you rotate whatever container is rendering the skeleton, it will rotate where you want.

O I had just needed the started bounding box. It’s okay :slight_smile:

Now i have a new problem, how i can change the originX and originY for rotation and rescale? Because the origin for the rotation is at animation’s bottom center and the origin for the rescale is at animation’s bottom left. I would the origin be at animations’s top left.
What are the possibles solution to make it?

The origin is a runtime specific thing. You can move the root bone so the top left is at the origin, then when you rotate whatever container is rendering the skeleton, it will rotate where you want.

A quick question guys, if you can help me with. Im creating an android java 2d shooter game.

I wanted to implement smooth animations into my game and came to this site and it seems very very good. However now im simply using image as my animation preset (sory for newbish programing talk). Do I need to somehow implement OpenGL into my engine to use this program for creating images?

It would mean a world to me if you could answer me :slight_smile:

P.S

The account activation was really unenecesary…

If you use your own game engine/toolkit then you need to implement a Spine runtime. See here:


If using Java you can base yours off the spine-libgdx runtime. However I would suggest to just use libgdx, for many reasons. :slight_smile:

A quick question guys, if you can help me with. Im creating an android java 2d shooter game.

I wanted to implement smooth animations into my game and came to this site and it seems very very good. However now im simply using image as my animation preset (sory for newbish programing talk). Do I need to somehow implement OpenGL into my engine to use this program for creating images?

It would mean a world to me if you could answer me :slight_smile:

P.S

The account activation was really unenecesary…

If you use your own game engine/toolkit then you need to implement a Spine runtime. See here:


If using Java you can base yours off the spine-libgdx runtime. However I would suggest to just use libgdx, for many reasons. :slight_smile:

Bringing this back just to mention we’ve launched our second Kickstarter today: