I am new to cocos2d .Can any one suggest me a method to give animation for the transition between one frame to another frame. this is my code to fetch frames and just display
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"spritesheet.plist"];
// Create a sprite sheet with the Happy Bear images
CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"spritesheet.png"];
[self addChild:spriteSheet];
// Load up the frames of our animation
walkAnimFrames = [NSMutableArray array];
for(int i = 1; i <=7; ++i) {
[walkAnimFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"sprite%d.png", i]]];
}
CCAnimation *walkAnim = [CCAnimation animationWithFrames:walkAnimFrames delay:0.1f];
// Create a sprite for our bear
CGSize winSize = [CCDirector sharedDirector].winSize;
self.sprite = [CCSprite spriteWithSpriteFrameName:@"sprite.png"];
self.sprite.position=ccp(320,480);
self.sprite.anchorPoint=ccp(1,1);
self.walkAction = [CCAnimate actionWithAnimation:walkAnim restoreOriginalFrame:NO];
How to do the animation for the transition between frames
thanks in advance
[self.sprite runAction:self.walkAction];- sdabet