Search code examples
cocos2d-iphonecocos2d-xparticle-system

cocos2d/cocos2d-x stopping particle system gracefully


Is there a way to stop a particle system gracefully -- ie. I call stop, and the particles dissipate naturally, no new particles are generated.


Solution

  • I use ParticleSystemQuad. So, to stop particles emitting, I set

    particle->stopSystem();
    particle->setAutoRemoveOnFinish(true);
    

    It stops the particle emission and then, after disappearing last particle, auto removes particle system.