tags:

views:

683

answers:

1

Hi all, trying to play around with the Cocos2d effects and created to methods to display and stop the Liquid action. My application however drops from 60fps down to 30fps when the effect is applied but the fps doesnt increase again when the scheduled stop action is called.

I originally thought that while the action has been completed the effect is still being rendered but after reading through the EffectsTest.h/.m in the Cocos2D 0.8 zip I cant find any reference to how this is achieved. Can anyone shed some light on this issue?

// effects
-(void)enableLiquidEffect
{
    id liquid = [Liquid actionWithWaves:6 amplitude:20 grid:ccg(15, 10) duration:3];

    [self schedule:@selector(disableLiquidEffect) interval:(3.0)];

    [self runAction:liquid];
}
-(void)disableLiquidEffect
{
    [self unschedule:@selector(disableLiquidEffect)];
    [self stopAllActions];
}


Cheers,
AntonMills

A: 

Just a guess but since the item will still have a transform set to liquid that it is still trying to apply a more complex transform then needed after its done. Save off your transform prior to starting and then when it stops set it back. You could try just setting it to nil.

Armychimp