707 Posted July 28, 2018 Share Posted July 28, 2018 I need align the text align horizontal and vertical center based on the background. The background is a graphics object. My code is not work properly. text = this.add.text(0, 0, ['2asdfasdf', '/nasdfn/', 'ndfdf'], { fontFamily: 'sans-serif', color: '#776e65', align: 'center', fontSize: 55, fontStyle: 'bold', padding: 0, }); It result is the picture, it just align based on the most longest text not the background. Link to comment Share on other sites More sharing options...
luotuo Posted August 4, 2018 Share Posted August 4, 2018 I have the same problem。 Link to comment Share on other sites More sharing options...
YuPi Posted August 6, 2018 Share Posted August 6, 2018 If you set the text origin to 0.5 and add it to the center (instead of the 0,0) of the background it should probably work. chasebeadles 1 Link to comment Share on other sites More sharing options...
Recommended Posts