CCSpawn使用CCRepeatForever无效

在使用CCSpawn中加入CCRepeatForever,但却无法使用CCRepeatForever的效果。

CCActionInterval* action =(CCActionInterval*)CCSpawn::create(CCRepeatForever::create(animate), scaleTo, NULL);

 

这样出现的结果,就只有缩放的效果,却没有CCRepeatForever的action。

原因是由于,CCSpawn是只同步执行有限时间内的动画,而持续的动画是无法持续。 

解决的办法是直接runAction。

sprite->runAction(scaleTo);
sprite->runAction(CCRepeatForever::create(animate));

 

 

posted on 2013-08-26 18:13  yuan19  阅读(603)  评论(0编辑  收藏  举报

导航