Question

As far as I understand particle system will start emitting once it's added to parent node. How can I add it to parent but not start it, so initially it will be inactive? Then whenever I need I can use resetSystem.

Was it helpful?

Solution

Send stopSystem to stop the particle emitter from emitting more particles. This will let existing particles continue until their lifetimes expire.

Send resetSystem to start the particle emitter. This will kill all existing particles but make the system start emitting new particles.

If you want to prevent the system from emitting any particles in the first place, set its emissionRate to 0 before adding it to its parent. Then set emissionRate to a positive number when you want it to emit particles. Take a look at the implementation of -[CCParticleSystem update:] method for details.

Also, as far as I can tell, the parent doesn't start the particle system. Instead, the particle system is simply created in the active state. Did you try sending stopSystem to the system before adding it to its parent? (Setting the totalParticles of a CCParticleSystemQuad also appears to reset the particle system to active.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top