int nSize;
nSize = 23;
SheetExplode = CCSpriteSheet::spriteSheetWithFile("Explode1.png" ,8);
this->addChild(SheetExplode,0);
spriteExplode = CCSprite::spriteWithTexture(SheetExplode->getTexture(),CGRectMake(0,0,23,23));
SheetExplode->addChild(spriteExplode,1,5);
spriteExplode->setPosition(posAt);
spriteExplode->setIsVisible(true);
CCAnimation *animation = CCAnimation::animationWithName("exp", 0.1f);
for(int i=0;i<8;i++) {
animation->addFrameWithTexture(SheetExplode->getTexture(), CGRectMake(i*nSize, 0, nSize, nSize) );
}
CCAnimate* ac1 = CCAnimate::actionWithAnimation(animation);
CCFiniteTimeAction* ac = CCSequence::actions(ac1, CCHide::action(), NULL);
spriteExplode->runAction(ac);
run and break down at
void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame)
{
m_obUnflippedOffsetPositionFromCenter = pNewFrame->getOffset();