Adibas03 Posted July 15, 2016 Share Posted July 15, 2016 Just realized that the text wrap function will not take effect if there are no spaces in the text. while this works game.stage.backgroundColor = '#0072bc'; var style = { font: 'bold 20pt Arial', fill: 'white', align: 'left', wordWrap: true, wordWrapWidth: 150 }; var text = game.add.text(game.world.centerX, game.world.centerY, "phaser with a sprinkle of pixi dust", style); this does not game.stage.backgroundColor = '#0072bc'; var style = { font: 'bold 20pt Arial', fill: 'white', align: 'left', wordWrap: true, wordWrapWidth: 150 }; var text = game.add.text(game.world.centerX, game.world.centerY, "phaserwithasprinkleofpixidust", style); Is this an issue or is this how it is supposed to be? Link to comment Share on other sites More sharing options...
themoonrat Posted July 15, 2016 Share Posted July 15, 2016 It's 'wordWrap'; the function looks at the string, and if it is too long, replaces a space with a new line. Because you only have one word, and therefore no spaces, it cannot find a place to insert a new line to keep the text within the wordWrapWidth Abhishek Singhal 1 Link to comment Share on other sites More sharing options...
Recommended Posts