我正在尝试使用我使用纹理打包器 (footballAnim-hd.pvr.ccz) 和 (footballAnim.pv-hd.plist) 创建的这些文件播放动画,但我遇到了一个问题。这是我的代码:
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"footballAnim.pv.plist"];
CCSprite *football = [CCSprite spriteWithSpriteFrameName:@"Football59-hd.png"];
football.position = ccp(100, 100);
CCSprite *football2 = [CCSprite spriteWithSpriteFrameName:@"Football59-hd.png"];
football2.position = ccp(120, 100);
//This is the animation
id anim = [CCAnimate actionWithSpriteSequence:@"Football%d-hd.png"
numFrames:59
delay:0.01
restoreOriginalFrame:NO];
//This is the animation
id anim2 = [CCAnimate actionWithSpriteSequence:@"Football%d-hd.png"
numFrames:59
delay:0.01
restoreOriginalFrame:NO];
//This is the action
id repeat = [CCRepeatForever actionWithAction:anim];
//This is the action
id repeat2 = [CCRepeatForever actionWithAction:anim2];
CCSpriteBatchNode *batchNode=[CCSpriteBatchNode batchNodeWithFile:@"footballAnim.pvr.ccz"];
[self addChild:batchNode];
[batchNode addChild:football];
[batchNode addChild:football2];
[football runAction:repeat];
[football2 runAction:repeat2];
所以我的问题是我使用的是 kobold2d,它正在使用(cocos2d v1.1.0-beta2b),当我尝试播放这个动画时,它只播放了一半的帧,但是我在另一个 cocos2d 项目中尝试了这个(EXACT)代码正在使用(cocos2d v1.0.0-rc),它就像一个魅力。这是 cocos2d 中的错误还是我做的不对?