cocos2d-iphoneccparticlesystem

CCParticleSystemQuad stop/pause/resume/play ability?


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


Solution

  • 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];