Jump to content

align bitmaptext


nak3ddogs
 Share

Recommended Posts

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

post-9438-0-01212400-1405519388_thumb.pn

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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