我想使用CCScaleTo扩展我的精灵。
这是我的代码:
CCSprite *spritePauseScreen =[CCSprite spriteWithFile:@"resumeGameScreenBG.png"] ;
spritePauseScreen.position= ccp(winSize.width/2,winSize.height/2);
spritePauseScreen.scale=0.5f;
[spritePauseScreen runAction:[CCScaleTo actionWithDuration:0.6 scaleX:1.0f scaleY:1.0f]];
[self addChild:spritePauseScreen z:7];
它不起作用。精灵仅在比例值0.5上显示。它没有扩大到1.0请帮助?...
答案 0 :(得分:3)
试用此代码。
int delayTime = 0.3f;
CCSprite *each = [CCSprite spriteWithFile:@"Icon.png"];
each.position = ccp(160,240);
each.scaleX = 0.0f;
each.scaleY = 0.0f;
CCAction *action = [CCSequence actions:
[CCDelayTime actionWithDuration: delayTime],
[CCScaleTo actionWithDuration:0.5F scale:1.0],nil];
delayTime += 0.2f;
[each runAction: action];
[self addChild:each];