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.
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
When replacing a custom
Textcomponent parent from a nativePhaser.GameObjects.Textby aBBCodeText, 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/strokeThicknessto style properties in the constructor, generate a visual issue.As you can see, I've made a step by step transition, from left to right:
BBCodeTextand applying the stroke manually (with a[stroke]tag), there is a text cut-off with a left text position shiftthis.setPaddingwith thickness as a value corrects the cut-offthis.x += thicknesscorrects the position shift but keeps the cut-offPhaser.GameObjects.Textstroke