我正在使用cocos2d製作遊戲。通過使用以下代碼,我添加了一個動畫。如何發送CCSprite
參考?在cocos2d中獲取發件人對象
if(sprite != monkey)
{
[self scheduleOnce:@selector(animate_sprite:) delay:0.1f];
}
-(void)animate_sprite:(ccTime) dt
{
id s2 = [CCScaleTo actionWithDuration:0.5 scaleX:2.0 scaleY:2.0];
id fun = [CCCallFuncN actionWithTarget:self selector:@selector(spriteDone:)];
[sprite runAction:[CCSequence actions:s2,fun,nil]];
}
如何獲得animate_sprite
方法中的精靈參考?
讓精靈伊娃,或給它一個標籤和使用getchildbytag – LearnCocos2D 2013-04-05 06:44:04