Skip to content

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

Closed
@likwidgames

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions