wyattbiker Posted October 27, 2018 Share Posted October 27, 2018 I have a piece of text and would like to set its origin as centered to display on the scene. E.g. Quote var gameOverText=this.add.text(centerX, centerY, 'G A M E O V E R', { fontSize: '60px' }); Is there a way to get the rendered text height, so I can set the origin how to place it on the screen? Thanks! Link to comment Share on other sites More sharing options...
GreenCloversGuy Posted October 27, 2018 Share Posted October 27, 2018 Origin is set on a scale of 0 to 1. If you want to set the origin, you can just use the setOrigin function! gameOverText.setOrigin(0.5) Example here: http://labs.phaser.io/edit.html?src=src\game%20objects\text\static\text%20origin.js wyattbiker 1 Link to comment Share on other sites More sharing options...
Recommended Posts