Jump to content

game.debug.text() is simple, any way to improve it?


sifon
 Share

Recommended Posts

Hello all,

 

I'm a new Phaser developer and I'm delighted with this framework, I'm a super fan  :)

 

I'd like to ask some help about the best way to display debug info, because the game.debug.text() function is really simple. For example I'd like to have a way to display a block text with multiline or fixed line width because now if I display a long line is not fitting in some small screens. My first approach is to display short lines using a variable for the y position:

var yPos = 0;for (property in results)	game.debug.text(results[property].id + ": " + results[property].value, 10, yPos += 20);

This way I have one line by property in lines of 20 pixels height, but I think this way of doing it is too basic, is there any other way of improve it?

 

Thanks!

Link to comment
Share on other sites

It's easy to forget you are working in html.

 

My solution was (also better performance) to have external (overlay) div element which you update with any text and any html/css. It is good if you don't need to update it's position (which wouldn't be a big problem either though).

 

The debug.text is not meant to be used extensively anyhow.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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