Jump to content

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 post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...