Jump to content

Bringing text to front


twoshorts
 Share

Recommended Posts

I was looking around for a way to bring text to front, as whenever I try to make text, and then create a new thing over the text, the text is no longer visible. I am currently going out of the way to put the text into a group and then bring the group to top, but this is a huge inconvenience to do for every text object.

 

Is there some method I don't know about that I can use for bringing text to the top? Or what is the common practice for doing this?

Link to comment
Share on other sites

Why not have a permanent group that is on top of everything and add all the text to that one as you create them?

I set my games up to use multiple groups as display layers:

//General idea, not my actual code...backGroup = game.add.group();spriteGroup = game.add.group();textGroup = game.add.group();guiGroup = game.add.group();
Link to comment
Share on other sites

  • 3 months later...

I'm afraid there isn't a clean way to do this in Phaser 1.1, but I did add Text.bringToTop() to Phaser 1.2 if you can hold out a couple of weeks.

 

Hey Rich, 

 

 

I'm using Phaser 2.0.5, but there's no such option to bring text to the front/top.

 

I also couldn't find it in the latest docs.

 

Do I have to put all the text elements in a group and bring that to top or is there any other way?

 

 

Thanks.

Link to comment
Share on other sites

Hey Rich, 

 

 

I'm using Phaser 2.0.5, but there's no such option to bring text to the front/top.

 

I also couldn't find it in the latest docs.

 

Do I have to put all the text elements in a group and bring that to top or is there any other way?

 

 

Thanks.

 

Hi,

 

I had similar problem - at the moment I use as workaround: 

...text.parent.bringToTop(text);...
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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