Skip to content

BBCodeText position shift with stroke #525

@Yozamu

Description

@Yozamu

When replacing a custom Text component parent from a native Phaser.GameObjects.Text by a BBCodeText, a few adjustments had to be made.

While some of them happen without issue, I noticed that the stroke, in addition to not applying when passing stroke / strokeThickness to style properties in the constructor, generate a visual issue.

Image

As you can see, I've made a step by step transition, from left to right:

  • Just after converting to BBCodeText and applying the stroke manually (with a [stroke] tag), there is a text cut-off with a left text position shift
  • Adding this.setPadding with thickness as a value corrects the cut-off
  • Adding this.x += thickness corrects the position shift but keeps the cut-off
  • Adding both seems to fix the issue and give a result similar to what it was with Phaser.GameObjects.Text stroke

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions