You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an array of messages that I want to display in a text, each in a new line. \n works fine, just not with longer texts that have been modified by word wrapping.
As you can see, Test 1 and Test 2 are on the same line as the longer text, despite the \n character.
Test 3 is then displayed again on a new line, as intended.
Example Test Code
The bug can be reproduced by inserting the following code in the Phaser 3 sandbox.
varconfig={width: 800,height: 600,scene: { create }};vargame=newPhaser.Game(config);functioncreate(){varmessages=['Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet','Test 1','Test 2','Test 3'];vartextStyle={wordWrap: {width: 385,useAdvancedWrap: true}};vartext=this.add.text(0,0,'',textStyle)text.setText(messages.join('\n'));}
Additional Information
This only happens with longer texts that are split into more lines by word wrapping.
The text was updated successfully, but these errors were encountered:
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.
Version
Description
I have an array of messages that I want to display in a text, each in a new line.
\n
works fine, just not with longer texts that have been modified by word wrapping.As you can see, Test 1 and Test 2 are on the same line as the longer text, despite the
\n
character.Test 3 is then displayed again on a new line, as intended.
Example Test Code
The bug can be reproduced by inserting the following code in the Phaser 3 sandbox.
Additional Information
This only happens with longer texts that are split into more lines by word wrapping.
The text was updated successfully, but these errors were encountered: