nak3ddogs Posted July 16, 2014 Share Posted July 16, 2014 helo. i would make my menu with bitmaptext. but for one single line i cant use align = 'center'and i cant get witdth of the bitmap text too. cant set the anchor point.any idea to align center or i have to mensurate the text with PS Link to comment Share on other sites More sharing options...
lewster32 Posted July 16, 2014 Share Posted July 16, 2014 BitmapText does not currently have an anchor, and alignment only works on multi-line text. To center a single line, you need to do the following currently:// ensure the text properties are updated internally (especially textWidth, which we will be using)bitmapText.updateText();// move the text to the left by half of its widthbitmapText.x -= bitmapText.textWidth * 0.5;Also, I should point out that while it doesn't matter in this case, you're using quite an old version of Phaser now - you may want to update to get some great new features and better performance. mtburdon and Le Twitch 2 Link to comment Share on other sites More sharing options...
nak3ddogs Posted July 16, 2014 Author Share Posted July 16, 2014 i use 2.01. i started learn phaser and js about 2-3 week ago. Link to comment Share on other sites More sharing options...
Recommended Posts