Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto calculated hit area is wrong #289

Closed
davyzhang opened this issue Aug 4, 2023 · 6 comments
Closed

Auto calculated hit area is wrong #289

davyzhang opened this issue Aug 4, 2023 · 6 comments

Comments

@davyzhang
Copy link

Version

  • Phaser Editor 2D Version:
    3.62.1
  • Operating System:
    windows
  • Web Browser and version:
    chrome

Description

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
Copy link
Owner

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

@davyzhang
Copy link
Author

davyzhang commented Aug 5, 2023

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

@PhaserEditor2D
Copy link
Owner

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

@PhaserEditor2D
Copy link
Owner

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

Screenshot 1

@davyzhang
Copy link
Author

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
Copy link
Owner

Fixed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants