Jump to content

Text Follow Camera


Apok.pt
 Share

Recommended Posts

  • 1 month later...

fixedToCamera is not available in Phaser.Text

 

I solved it :

 

- Created a Sprite with fixedToCamera = true

- addChild of my text at x:0, y:0

- position the cameraOffset of my Sprite

 

I am completely new to Phaser and I'm trying to do the same thing.  I don't understand your solution.  Would you be able to provide some code to explain this fix?

Link to comment
Share on other sites

//Created a Sprite with fixedToCamera = truevar sprite = game.add.sprite(0,0);sprite.fixedToCamera = true;//addChild of my text at x:0, y:0var text = game.add.text(0,0,"Score: ");sprite.addChild(text);//position the cameraOffset of my Spritesprite.cameraOffset.x = 10;sprite.cameraOffset.y = 100;

However, this solution is no longer needed in the latest Phaser code...

In the Dev branch, you can fix a text object to the camera

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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