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

getBounds() does not detect BitmapText size in Container #6237

Closed
likwidgames opened this issue Oct 4, 2022 · 1 comment
Closed

getBounds() does not detect BitmapText size in Container #6237

likwidgames opened this issue Oct 4, 2022 · 1 comment

Comments

@likwidgames
Copy link

Version

  • Phaser Version: 3.55.2
  • Operating system: macOS Venture 13.0

Description

Using getBounds() on a container that contains only bitmapText returns 0 for height/width. It doesn't seem to calculate the size of the text. If I replace the text with an Image instead, it calculates the height/width just fine.

After some research, it seems BitmapText has a method .getTextBounds() instead of getBounds() like Text or Sprite.

Example Test Code

https://codepen.io/likwidgames/pen/vYjaOoo

Additional Information

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

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