rayxuln / spine-runtime-for-godot

This project is a module for godot that allows it to load/play Spine skeleton animation.
MIT License
93 stars 22 forks source link

Adds support for bounding boxes #34

Closed tlazaro closed 2 years ago

tlazaro commented 2 years ago

Hi, after almost a year I came back to Godot and Spine and found my code to add support for bounding boxes. I have now updated it to your spine 4.0 and though would be nice to share and collaborate so we can end up with a better solution.

Pretty sure I didn't code most of it, I think it was based on someone else's code but sadly can't remember where it came from. I made some fixes to the original, added support for coloring the bounding boxes and added icons from spine. More info here: http://esotericsoftware.com/forum/More-precise-Bounding-Box-15078

Let me know what you think.

rayxuln commented 2 years ago

I'm glad that you added bounding box support into this module and the icons look pretty. However I've already added the bounding box support after upgrading spine-cpp to 4.0 version (the 3.8 version also has the bounding box support). You can check out on this page: https://github.com/rayxuln/spine-runtime-for-godot/wiki#how-to-use-the-bounding-box-in-the-spinesprite

I added a SpineCollisionShapeProxy type node that considered as a collision shape and can be placed under any physical body/area node without moving the SpineSprite. Since the SpineCollisionShapeProxy node is a collision shape, you can turn on "Visible Collision Shapes" in Debug menu to view the bounding box at runtime.

I will consider the icons. Thank you very much!

tlazaro commented 2 years ago

Oh I see, will check it out! Thanks for your quick response.

The icons I made myself, using the official Spine icon svg, feel free to add them, makes it look much cooler in the editor! :D