Jump to content

center text on screen


digitsensitive
 Share

Recommended Posts

Hello there! I am not sure if there is already a function to center a text (f.e. BitmapText)?

If not, this might be helpful. The function could be quite simple I guess (not tested):

getCenterX: function ()
{
   return sys.canvas.width / 2 - this._bounds.global.width / 2
}

EDIT (28.04.2018): Just saw that there is a getCenter() function in the GetBounds component. Maybe BitmapText could extend GetBounds too? 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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