How can we set time delay in animation of images to make them appear smooth ?
Posted
by srikanth rongali
on Stack Overflow
See other posts from Stack Overflow
or by srikanth rongali
Published on 2010-05-18T09:56:59Z
Indexed on
2010/05/18
10:00 UTC
Read the original article
Hit count: 249
Hi, I have 10 CCSprite images. They are continues images. I am using,
CCSprite *playerH = [CCSprite spriteWithFile:@"Player_01.png" ];
playerH.position = ccp(playerH.contentSize.width/2, windowSize.height/2);
[self addChild:playerH z:1];
CCAnimation* animation = [CCAnimation animationWithName:@"dance" delay:0.20f];
for( int i = 1; i < 11; i++ )
{
[animation addFrameWithFilename: [NSString stringWithFormat:@"Player_%02d.png", i]];
}
NSLog(@"k VALUE: k: %d",k);
id actionA = [CCAnimate actionWithAnimation: animation restoreOriginalFrame:NO];
id actionD = [CCDelayTime actionWithDuration:5.0f];
id actionC = [CCCallFunc actionWithTarget:self selector:@selector(enemyEntranceScreen:)];
id seqActionPlayer = [CCSequence actions:actionA, actionD, actionC, nil];
[playerH runAction: seqActionPlayer];
But the animation is not continues. I have changed the animation delay time. but, I can see only three images appearing. How can we know how much time interval should we keep in animation.
Is there any relationship between this and the frame rate
[[CCDirector sharedDirector] setAnimationInterval:1.0/60];
[[CCDirector sharedDirector] setDisplayFPS:YES];
Thank you.
© Stack Overflow or respective owner