Jump to content

Word wrap in Phaser 3+


JesusJoseph
 Share

Recommended Posts

I need to add a help content for the game.

I need to set word wrap for the help content. 

In version 2 I use below code to set word wrap. But in version 3 its not working

helpText.setTextBounds(16, 20, 768, 568);

Can someone please tell me how to set word wrap in Phaser 3 

Thanks for your help

Full Code below

var helpContent = "Help Content Come here" + 
			"Help Content Come here" + 
"Help Content Come here";
		var style = { font: "24px Arial", align: "left", wordWrap: true, wordWrapWidth: 450 };
		var helpText = me.add.text(0, 50, helpContent, style);
		helpText.setTextBounds(16, 20, 768, 568);

 


 

Link to comment
Share on other sites

  • 4 weeks later...
On 6/15/2018 at 12:00 AM, squilibob said:

wordWrap is an object


        var style = = { 
            fontSize: 24,
            fontFamily: 'Arial',
            align: "left",
            wordWrap: { width: 450, useAdvancedWrap: true }
        }

 

 

On 6/15/2018 at 12:00 AM, squilibob said:

wordWrap is an object


        var style = = { 
            fontSize: 24,
            fontFamily: 'Arial',
            align: "left",
            wordWrap: { width: 450, useAdvancedWrap: true }
        }

it works thanks 

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...