Jump to content

Problems with Text


Romiar
 Share

Recommended Posts

Hi Guys.

I'm new of PixiJS and i have 2 problems with Text object.

1) when i set "center" the align property in the textstyle, the content start always from left side.

2) as in actionscript3, there is a way to intercept the changing of the text when i change his content?

 

Thank you

Link to comment
Share on other sites

Hello, fellow Flash user! Pixi has different API, but most of things from Flash can be mapped. I know that flash text API contained more stuff than Pixi.

1) You can change "anchor" property to 0.5, it will work like a Sprite - generated texture center will appear in position of element.

2) https://github.com/pixijs/pixi.js/blob/dev/src/core/text/Text.js#L119 that function is lazy, its called from multiple places. You can override it or "set text" thingy from outside, I hope you know how to do it in js.

If you want to know more about text, look in the same directory - its all we have on text. There's also BitmapText but its usage is limited to cases when you need max performance on text.

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

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