CCAnimation* animation = CCAnimation::create();
for(int i = 1; i < 15; i++)
{
CCString* fileName = CCString::createWithFormat("grossini_dance_%02d.png",i);
// CCSize spriteSize = sprite->getContentSize();
// CCRect rect = CCRect(0, 0, spriteSize.width, spriteSize.height);
// CCSpriteFrame* frame = CCSpriteFrame::create(fileName->getCString(), rect);
// animation->addSpriteFrame(frame);
animation->addSpriteFrameWithFileName(fileName->getCString());
}
animation->setDelayPerUnit(0.1f);
animation->setLoops(-1);
CCAnimate* animate = CCAnimate::create(animation);
for(int i = 1; i < 15; i++)
{
CCString* fileName = CCString::createWithFormat("grossini_dance_%02d.png",i);
// CCSize spriteSize = sprite->getContentSize();
// CCRect rect = CCRect(0, 0, spriteSize.width, spriteSize.height);
// CCSpriteFrame* frame = CCSpriteFrame::create(fileName->getCString(), rect);
// animation->addSpriteFrame(frame);
animation->addSpriteFrameWithFileName(fileName->getCString());
}
animation->setDelayPerUnit(0.1f);
animation->setLoops(-1);
CCAnimate* animate = CCAnimate::create(animation);