Jump to content

How to display score text on a world map


atlantageek
 Share

Recommended Posts

Working on a defender like platform game with constant horizontal scrolling. How do I display the text in a way where it stays on the screen and does not move as the camera moves in the world map

 

Here is my current code.

 this.flap_energy_txt = this.game.add.text(200, 0, "Text", style);

 

Link to comment
Share on other sites

 as XekeDeath said....

this.flap_energy_txt.fixedToCamera = true;

i saw you gave it an x value of 200  - you can also use game.camera.width/2  to always center it for example

this.flap_energy_txt = this.game.add.text(this.game.camera.width/2, 0, "Text", style);this.flap_energy_txt.anchor.setTo(0.5,0.5);this.flap_energy_txt.fixedToCamera = true;
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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