CCParticleSystemQuad stop/pause/resume/play ability?

538 Views Asked by At

looking if there is a pause/resume method in this class.
something like :[CCParticleSystemQuad resume];
do I missing ? or not exists ?

2

There are 2 best solutions below

0
CodeSmile On BEST ANSWER

Not officially. But you could edit the source code, add a BOOL property paused and check the paused flag in the update method:

-(void) update:(ccTime)delta
{
    if (_paused == NO)
    {
        // update particles code here...
    }
}

No guarantee that it'll work but it's worth giving it a try.

It might also be possible without changing the code, but this will affect other scheduled methods and actions too:

[particleSystem pauseSchedulerAndActions];

To resume:

[particleSystem resumeSchedulerAndActions];
0
mostafa88 On

Another trick that I used, was setEmissionRate() function. To pause particle system:

setEmissionRate(0);

To resume particle system:

setEmissionRate(latestValue);

I hope this should be good for you :)