Jump to content

Problems with text lines

A potato

Recommended Posts

Hi! I'm having a problem with the phaser 2 online editor.

I'm trying to create some text on multiple lines so I tried using  \n or \r and while the do work initially, if I reload the page it splits the code itself.

So initially my code is


game.add.text(157, 140, 'This is you,\nyou can move around\nin 8 directions\nwith the arrow keys.' , {font: "18px Arial", fill: '#FFFFFF'});

But when I reload the page it becomes


game.add.text(157, 140, 'This is you,

you can move around

in 8 directions

with the arrow keys.' , {font: "18px Arial", fill: '#FFFFFF'});

Does anyone have a solution?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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