复制代码
-
auto animation = Animation::create();
-
for( int i=1;i<15;i++)
-
{
-
char szName[100] = {0};
-
sprintf(szName, "Images/grossini_dance_%02d.png", i);
-
animation->addSpriteFrameWithFile(szName);
-
}
-
// should last 2.8 seconds. And there are 14 frames.
-
animation->setDelayPerUnit(2.8f / 14.0f);
-
animation->setRestoreOriginalFrame(true);
-
-
auto action = Animate::create(animation);
-
_grossini->runAction(Sequence::create(action, action->reverse(), NULL));
|