atlantageek Posted May 22, 2014 Share Posted May 22, 2014 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 More sharing options...
XekeDeath Posted May 22, 2014 Share Posted May 22, 2014 Use the fixedToCamera property. Link to comment Share on other sites More sharing options...
valueerror Posted May 22, 2014 Share Posted May 22, 2014 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 examplethis.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 More sharing options...
Recommended Posts