Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for working with multiple emitters? #47

Closed
mspanish opened this issue Feb 26, 2017 · 2 comments
Closed

Best practices for working with multiple emitters? #47

mspanish opened this issue Feb 26, 2017 · 2 comments

Comments

@mspanish
Copy link

Sorry to be such a noob at this, but as I've never worked with particles before this is all new to me! I've got 3 or 4 cool effects I'm using - 3 are burst type things that only run once when something happens, and 1 is an ongoing bubble generator that runs all of the time.

Do I need to do something to clean up the "run once" emitters? Is it ok to just keep creating them over and over again, or should I create them all in the beginning, and then start and stop them?

thanks in advance for any advice!

@andrewstart
Copy link
Contributor

andrewstart commented Feb 27, 2017

Because the emitters reuse their particles, it is better to keep the "run once" emitters for the next time you need them. When you no longer need them, you should call their destroy() method to make sure that they and all their particles get garbage collected. That does not destroy the Textures that they use, so if you'd like to clean up the memory from those, you'll have to destroy them (and their BaseTextures) yourself.

@mspanish
Copy link
Author

Thank you, that is really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants