mise Posted August 21, 2018 Share Posted August 21, 2018 Hi, I'm trying to center text in a Container. Currently using align='center' and text.center(), but i'm not getting the text to center in height as well. I can't get it to work because the text dimensions are 0: var text = new game.SystemText('text') text.addTo(this.stage); // text.width === 0 Thanks, Mise Quote Link to comment Share on other sites More sharing options...
enpu Posted August 23, 2018 Share Posted August 23, 2018 Hi @mise In SystemText you can set align property to center, take a look at this example: https://www.panda2.io/examples#systemText-props Note that SystemText is really designed to be used just as debugging or placeholder text, for actual in-game texts i would suggest to use Text class. Quote Link to comment Share on other sites More sharing options...
mise Posted August 23, 2018 Author Share Posted August 23, 2018 yeah, I already switched to Text() because I also needed the wrapping feature. There is still something going on with the SystemText dimensions though, but it's up to you if you want to look into it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.