我想在cocos2D
中製作sprite animate
。我相信我已經設置了動畫,但是如何在屏幕上繪製animating sprite
?以下是我有:提前Cocos2d中的動畫。
id anim = [[[CCAnimation alloc] initWithName:@"char_walking" delay:1/12.0] autorelease];
[anim addFrame:@"run2.png"];
[anim addFrame:@"run1.png"];
[anim addFrame:@"run3.png"];
[anim addFrame:@"run4.png"];
[anim addFrame:@"run3.png"];
[anim addFrame:@"run1.png"];
id myAction = [CCAnimate actionWithAnimation:anim];
id repeating = [CCRepeatForever actionWithAction:myAction];
[character do:repeating];
character = [CCSprite spriteWithSpriteFrame:anim];
character.position = ccp(160, 240);
[self addChild:character];
感謝, 約翰
這就是我所做的,我覺得很愚蠢。 – tallen11 2011-02-13 23:37:55