Exca Posted September 23, 2016 Share Posted September 23, 2016 Is it possible to change the size of the particle container after it has been created? I have a situation where I need to render different amount of objects depending on the size of the canvas (which changes for example when entering fullscreen). Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 23, 2016 Share Posted September 23, 2016 You can add or remove objects from it at any time. Quote Link to comment Share on other sites More sharing options...
Exca Posted September 23, 2016 Author Share Posted September 23, 2016 Adding objects as long as the max size is not exceeded works. But if the amount of children exceeds maxsize the rest wont get rendered in webgl. What I would like to do is adjust the maxsize dynamically. One way would be just destroying the particlecontainer and building new one with larger size. Or build one initially that supports the maximum amount of particles. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 23, 2016 Share Posted September 23, 2016 Good question, the direct answer is: No, you can't change the max size of a ParticleContainer after creation easily. Normally you would just create one with the max size that you will have, I would only worry about reducing that number and dynamically creating containers if your max size seems to cause perf issues at the lower size. Or if you think that the transition between the two states (low max, and higher max) will almost never happen. Unless the difference between the small and large is a few thousand, I wouldn't worry about it, just do the big one always. Exca 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.