Romiar Posted December 28, 2017 Share Posted December 28, 2017 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 28, 2017 Share Posted December 28, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.