小黑米的生活

只玩技术

[cocos2d] schedule

leave a comment

在处理Sprite的时候,需要设置Sprite的行为,需要使用到schedule,第一个参数就是selector对象,额~ 理解成C语言的函数指针就对了~

[self unschedule:@selector(spidersUpdate:)];
[self schedule:@selector(spidersUpdate:) interval:3.0f];
[self scheduleUpdate];//==[self scheduleUpdate:@selector(update:) interval:0.0f];
// stop the scheduled selectors
[self unscheduleAllSelectors];

// Manually schedule update via the undocumented CCScheduler class used internally by CCNode.
[[CCScheduler sharedScheduler] scheduleUpdateForTarget:self priority:0 paused:NO];

// Must manually unschedule, it is not done automatically for us.

[[CCScheduler sharedScheduler] unscheduleUpdateForTarget:self];

原创文章,转载请注明: 转载自小黑米的生活

本文链接地址: [cocos2d] schedule

Written by edwardhey

十月 4th, 2011 at 10:04 下午

Posted in 技术,游戏

Leave a Reply

无觅相关文章插件,快速提升流量