How to add Bounding Boxes to Dragon Bones animation

Hi all,

I am interested in adding some simple rectangular bounding boxes to an animation, I have seen that DataParser.hx and ObjectDataParser.hx files are supposed to be able to parse different types of bounding boxes from a .json file but if I export my animations from directly Dragon Bones it doesn’t include any information for those purposes.

I don’t know if I have to add that info directly to Dragon Bones program using “import data” inside the program?

Or if I have to add that info using OpenFLFactory.factory.parseDragonBonesData method?

Versions:
Dragon Bones Pro 5.6
Dragon Bones lib 5.1.1

Hi,

There are not many dragonbones users around here I think :slight_smile:

I’m using it for a game which has been on pause for months now, I think the easiest would be to add the bounding boxes in the Dragon Bones editor. We use a few invisible “bones” for stuff like casting a fireball from a pointed finger but we used Flash for all our DB animations (we tried DB editor back when we started working on this but it had some issues that didn’t occur with Flash) so I can’t tell you how to do that exactly.

It’s been a while but if I remember correctly in Flash we just had to create those bones like regular ones and make them invisible, I would try something like that with DB editor

Also a warning : last summer I finally fixed a crash that would occur on windows target, and it turned out dragonbones was at fault… at least the code used with Starling. I wanted to explore this further and test regular openFL but I didn’t. There’s also a small memory leak when using dragonbones with Starling that I didn’t look into yet. You can look here for more explanations and a link to my modifications : How to debug random GC.h crash on windows target?

Thanks Matse for your answer, I will have a look to the invisible “bones” approach :slight_smile:

I am not using Starling at the moment, so hopefully I will not have to deal with that crash :wink:

You’re welcome :slight_smile:

As I said I didn’t look into regular openfl with dragonbones, but I highly suspect the crash is there as well since it was not related to display specifically, it was something with Vectors. I think it only happened when pooling a skeleton and re-using it with different data though so if you don’t do that you might not experience it.
If you get it feel free to ping me, I’ll be happy to help :wink: