Armature boundingBox

BoundingBox in my armature object is not in the right place.
Same problem like this topic:

Like bounding box is moved on the right side, so i can only touch right half of my armature object.

Any help?

Is the sprite from an atlas? Is the sprite rotated?

It seems the sprite is embedded rotated in the atlas and the bounding box does not reflect that rotation.

Yes, sprite is in atlas (i think that is how cocostudio is exporting project).
I didn’t rotated sprite…
Is there any way to fix this, but not to “hack” engine?

So, is the sprite in the atlas rotated?

Is the red border around the sprite also just the rotated sprite?

If both is true, it’s a bug. You would have to check if the sprite got rotated in the atlas, and rotate your bounding box accordingly.

I can’t draw boundingBox…but when i have tested touch listener, i assume that bounding box is rotated.

Something like this:

Red rectangle is boundingBox, this black circle is my object.

I think that problem is, my armature object has anchor point at 0.5, 0.5…so bounding box for that object, is in center of armature…how to solve this?

Problem solved:

  • I have just moved rect for width/2 and height/2.

Rect rect = Rect(0-s.width/2,0-s.height/2, s.width, s.height);
if (rect.containsPoint(locationInNode))
{

}