Adibas03

Phaser js Text wrap not working

Recommended Posts

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.