PhaserEditor2D / PhaserEditor2D-v3

A web-based IDE for HTML5 game development. Powered by Phaser.
https://phasereditor2d.com
MIT License
426 stars 57 forks source link

Auto calculated hit area is wrong #289

Closed davyzhang closed 1 year ago

davyzhang commented 1 year ago

Version

The image working as a button is nested in 2 containers as the picture shows. Clicking on enable hit area, will give the wrong rectangle.

Possible solution

Calculate the size and Update the rectangle manually. It looks like the editor only goes up one level to read the

image
PhaserEditor2D commented 1 year ago

Please, can you make a small project, with only that scene, so I can reproduce the error?

davyzhang commented 1 year ago

No problem, check the attachment please. Try to toggle off and back on the HitArea will reproduce the problem bug.zip

PhaserEditor2D commented 1 year ago

Ok, I see a couple of issues here. I keep you updated.

PhaserEditor2D commented 1 year ago

Oh! I found it! The hit area is rendered far away from the object:

Screenshot 1
davyzhang commented 1 year ago

Thank you so much for working on t this, sorry for confusion, the data shows in the editor shoudn't offset to the parent. glad you found it

image
PhaserEditor2D commented 1 year ago

Fixed. Thanks.