Thomasdah Posted October 5, 2016 Share Posted October 5, 2016 For my Pixi Project, i need to display 4 short numbers: 15, 30, 45 and 60 over 200 times on my stage. Also, on window resize - the text will get resized not based on linear window dimensions. Because of this, i think it is a good strategy to create textures for those 4 numbers and use them when i create the sprites. var minute = new PIXI.Sprite(minute_30_texture); My Problem: i am not able to create Sprites from PIXI.Text("30").texture; var texture = new PIXI.Text("30").texture; var sprite = new PIXI.Sprite(texture); the rendered sprite will not show anything. (using pixi 4.0.3) Anyone with the same problem? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 5, 2016 Share Posted October 5, 2016 May the "text.updateText()" be with you. https://github.com/pixijs/pixi.js/blob/master/src/core/text/Text.js#L209 "text" field has a lazy assignment: https://github.com/pixijs/pixi.js/blob/master/src/core/text/Text.js#L184 Quote Link to comment Share on other sites More sharing options...
Thomasdah Posted October 6, 2016 Author Share Posted October 6, 2016 You solved my Issue. Thanks! Quote Link to comment Share on other sites More sharing options...
MariaK Posted February 12, 2020 Share Posted February 12, 2020 On 10/6/2016 at 12:17 PM, Thomasdah said: You solved my Issue. Thanks! how you can do it? i have the same problem.. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 14, 2020 Share Posted February 14, 2020 On 2/12/2020 at 10:14 AM, MariaK said: how you can do it? i have the same problem.. @MariaK Welcome to the forums! There is a thing I call a telepathy - how fast someone can determine the other person problem without reproducible demo. Sometimes people guess right by only a few words, yes, but it takes experience. Thomasdah has 2 posts. His last post was in 2016. You have 0.1% probability that this kind of question will be answered by someone in a week. I recommend you to reformulate your question, give more information and maybe explain what in my solution is difficult to understand. Reproducible demo is the best attachment to question, but we can try use my telepathy. Quote Link to comment Share on other sites More sharing options...
helgeman Posted June 14, 2020 Share Posted June 14, 2020 Hi, Could it be that in the newest version of pixi ```text.updateText() ``` does not exist anymore? What is the best way to update a sprite that created from a Text objects texture? Regards Helge 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.