
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
None | size: 0.87 KB | hits: 8 | expires: Never
Cocos2d scheduling selector in child node
ParallaxMultipleBackgrounds *background = [self getChildByTag:GameSceneBackgroundBase];
//I TRIED THIS:
[background schedule:@selector(([background changeSpeedFactorBy:3])) interval:1];
//AND
[background schedule:@selector(changeSpeedFactorBy:3)];
//AND
[[background schedule:@selector(changeSpeedFactorBy:3) interval:1] ];
//BUT..
ParallaxMultipleBackgrounds *background = [self getChildByTag:GameSceneBackgroundBase];
background.modifier = 3;
[background schedule:@selector(changeSpeedFactorBy:) interval:1];
CCCallFuncND *call = [CCCallFuncND actionWithTarget:background selector:@selector(changeSpeedFactorBy:) data:amont];
CCDelay *delay = [CCDelay actionWithDuration:1];
CCSequence *seq = [CCSequence actions:call,delay,nil];
CCRepeatForever *repeat = [CCRepeatForever actionWithAction:seq];
[background runAction:repeat];