Sincere Xie Posted April 25, 2019 Share Posted April 25, 2019 Hi all.I am a beginner of pixi.js, and using PIXI.Graphics to create a circular progress bar that will move over time, the effect is like the one below: https://codepen.io/saadeghi/pen/IBhfJ More specifically, the circular progress bar moves over time. So, the graphics is modified constantly, this caused a very serious performance problem and even caused the iOS system to crash. My question is what should I do to implement such a circular progress bar in pixijs? My English is poor, thank you for reading. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 25, 2019 Share Posted April 25, 2019 It should work. Don't forget to clear() graphics. Also, it depends on pixijs version, some of v5 versions were unstable, I recommend to use latest dev http://pixijs.download/dev/pixi.js One of ideas is sprite with full circle and mask that you modify each frame. If mask is somehow leaking please report it to us, it should work. Sincere Xie 1 Quote Link to comment Share on other sites More sharing options...
bubamara Posted April 25, 2019 Share Posted April 25, 2019 If you don't need gradients, there is this clever 3 sprites approach : Sincere Xie and ivan.popelyshev 1 1 Quote Link to comment Share on other sites More sharing options...
Sincere Xie Posted April 27, 2019 Author Share Posted April 27, 2019 On 4/26/2019 at 12:57 AM, ivan.popelyshev said: It should work. Don't forget to clear() graphics. Also, it depends on pixijs version, some of v5 versions were unstable, I recommend to use latest dev http://pixijs.download/dev/pixi.js One of ideas is sprite with full circle and mask that you modify each frame. If mask is somehow leaking please report it to us, it should work. Thanks to @ivan.popelyshev, I have done my work with the Sprite. I am not sure if the new version of pixijs has such a memory leak, the version I am using is 4.8.1, and I put the webpage in the foreground for almost three hours before the memory leak occurred. I also found that this document(https://github.com/pixijs/pixi.js/wiki/v4-Performance-Tips) has prompted us not to draw Graphics frequently. Quote Link to comment Share on other sites More sharing options...
Sincere Xie Posted April 27, 2019 Author Share Posted April 27, 2019 @bubamara Thank you! The answer you gave solved the problem perfectly. bubamara 1 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.