466フレームで19秒のアニメーションを実行する必要があります。各フレームは「1024x768」です。zwoptexを使用してスプライトシートを作成していますが、シートは「4096 X 4096」で、15フレームしか保持できません。
私は複数のシートを作成しました。正確には30枚で、アニメーションを実行しますが、2〜3枚のシートを使用すると、非常にスムーズになります。
これが私のコードです
cache=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache addSpriteFramesWithFile:@"Set_1.plist"];
cache1=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache1 addSpriteFramesWithFile:@"Set_2.plist"];
cache2=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache2 addSpriteFramesWithFile:@"Set_3.plist"];
cache3=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache3 addSpriteFramesWithFile:@"Set_4.plist"];
cache4=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache4 addSpriteFramesWithFile:@"Set_5.plist"];
cache5=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache5 addSpriteFramesWithFile:@"Set_6.plist"];
cache6=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache6 addSpriteFramesWithFile:@"Set_7.plist"];
cache7=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache7 addSpriteFramesWithFile:@"Set_8.plist"];
cache8=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache8 addSpriteFramesWithFile:@"Set_9.plist"];
cache9=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache9 addSpriteFramesWithFile:@"Set_10.plist"];
cache10=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache10 addSpriteFramesWithFile:@"Set_11.plist"];
cache11=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache11 addSpriteFramesWithFile:@"Set_12.plist"];
cache12=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache12 addSpriteFramesWithFile:@"Set_13.plist"];
cache13=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache13 addSpriteFramesWithFile:@"Set_14.plist"];
cache14=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache14 addSpriteFramesWithFile:@"Set_15.plist"];
cache15=[CCSpriteFrameCache sharedSpriteFrameCache];
[cache15 addSpriteFramesWithFile:@"Set_16.plist"];
equ=[CCSprite spriteWithFile:@"m1.png"];
[self addChild:equ z:5 tag:90 ];
equ.anchorPoint=ccp(0, 0);
equ.position=ccp(0, 0);
NSMutableArray *framesArray=[NSMutableArray array];
NSMutableArray *framesArray1=[NSMutableArray array];
NSMutableArray *framesArray2=[NSMutableArray array];
NSMutableArray *framesArray3=[NSMutableArray array];
NSMutableArray *framesArray4=[NSMutableArray array];
NSMutableArray *framesArray5=[NSMutableArray array];
NSMutableArray *framesArray6=[NSMutableArray array];
NSMutableArray *framesArray7=[NSMutableArray array];
NSMutableArray *framesArray8=[NSMutableArray array];
NSMutableArray *framesArray9=[NSMutableArray array];
NSMutableArray *framesArray10=[NSMutableArray array];
NSMutableArray *framesArray11=[NSMutableArray array];
NSMutableArray *framesArray12=[NSMutableArray array];
NSMutableArray *framesArray13=[NSMutableArray array];
NSMutableArray *framesArray14=[NSMutableArray array];
// NSMutableArray *framesArray15=[NSMutableArray array];
for (int i=1; i<=15; i++) {
NSString *frameName=[NSString stringWithFormat:@"m%d.png", i];
NSString *frameName1=[NSString stringWithFormat:@"m%d.png", i+(15*1)];
NSString *frameName2=[NSString stringWithFormat:@"m%d.png", i+(15*2)];
NSString *frameName3=[NSString stringWithFormat:@"m%d.png", i+(15*3)];
NSString *frameName4=[NSString stringWithFormat:@"m%d.png", i+(15*4)];
NSString *frameName5=[NSString stringWithFormat:@"m%d.png", i+(15*5)];
NSString *frameName6=[NSString stringWithFormat:@"m%d.png", i+(15*6)];
NSString *frameName7=[NSString stringWithFormat:@"m%d.png", i+(15*7)];
NSString *frameName8=[NSString stringWithFormat:@"m%d.png", i+(15*8)];
NSString *frameName9=[NSString stringWithFormat:@"m%d.png", i+(15*9)];
NSString *frameName10=[NSString stringWithFormat:@"m%d.png", i+(15*10)];
NSString *frameName11=[NSString stringWithFormat:@"m%d.png", i+(15*11)];
NSString *frameName12=[NSString stringWithFormat:@"m%d.png", i+(15*12)];
NSString *frameName13=[NSString stringWithFormat:@"m%d.png", i+(15*13)];
NSString *frameName14=[NSString stringWithFormat:@"m%d.png", i+(15*14)];
id frameObject=[cache spriteFrameByName:frameName];
id frameObject1=[cache1 spriteFrameByName:frameName1];
id frameObject2=[cache2 spriteFrameByName:frameName2];
id frameObject3=[cache3 spriteFrameByName:frameName3];
id frameObject4=[cache4 spriteFrameByName:frameName4];
id frameObject5=[cache5 spriteFrameByName:frameName5];
id frameObject6=[cache6 spriteFrameByName:frameName6];
id frameObject7=[cache7 spriteFrameByName:frameName7];
id frameObject8=[cache8 spriteFrameByName:frameName8];
id frameObject9=[cache9 spriteFrameByName:frameName9];
id frameObject10=[cache10 spriteFrameByName:frameName10];
id frameObject11=[cache11 spriteFrameByName:frameName11];
id frameObject12=[cache12 spriteFrameByName:frameName12];
id frameObject13=[cache13 spriteFrameByName:frameName13];
id frameObject14=[cache14 spriteFrameByName:frameName14];
[framesArray addObject:frameObject];
[framesArray1 addObject:frameObject1];
[framesArray2 addObject:frameObject2];
[framesArray3 addObject:frameObject3];
[framesArray4 addObject:frameObject4];
[framesArray5 addObject:frameObject5];
[framesArray6 addObject:frameObject6];
[framesArray7 addObject:frameObject7];
[framesArray8 addObject:frameObject8];
[framesArray9 addObject:frameObject9];
[framesArray10 addObject:frameObject10];
[framesArray11 addObject:frameObject11];
[framesArray12 addObject:frameObject12];
[framesArray13 addObject:frameObject13];
[framesArray14 addObject:frameObject14];
}
id animObject=[CCAnimation animationWithSpriteFrames:framesArray delay:0.0407];
id animObject1=[CCAnimation animationWithSpriteFrames:framesArray1 delay:0.0407];
id animObject2=[CCAnimation animationWithSpriteFrames:framesArray2 delay:0.0407];
id animObject3=[CCAnimation animationWithSpriteFrames:framesArray3 delay:0.0407];
id animObject4=[CCAnimation animationWithSpriteFrames:framesArray4 delay:0.0407];
id animObject5=[CCAnimation animationWithSpriteFrames:framesArray5 delay:0.0407];
id animObject6=[CCAnimation animationWithSpriteFrames:framesArray6 delay:0.0407];
id animObject7=[CCAnimation animationWithSpriteFrames:framesArray7 delay:0.0407];
id animObject8=[CCAnimation animationWithSpriteFrames:framesArray8 delay:0.0407];
id animObject9=[CCAnimation animationWithSpriteFrames:framesArray9 delay:0.0407];
id animObject10=[CCAnimation animationWithSpriteFrames:framesArray10 delay:0.0407];
id animObject11=[CCAnimation animationWithSpriteFrames:framesArray11 delay:0.0407];
id animObject12=[CCAnimation animationWithSpriteFrames:framesArray12 delay:0.0407];
id animObject13=[CCAnimation animationWithSpriteFrames:framesArray13 delay:0.0407];
id animObject14=[CCAnimation animationWithSpriteFrames:framesArray14 delay:0.0407];
id animAction=[CCAnimate actionWithAnimation:animObject];
id animAction1=[CCAnimate actionWithAnimation:animObject1];
id animAction2=[CCAnimate actionWithAnimation:animObject2];
id animAction3=[CCAnimate actionWithAnimation:animObject3];
id animAction4=[CCAnimate actionWithAnimation:animObject4];
id animAction5=[CCAnimate actionWithAnimation:animObject5];
id animAction6=[CCAnimate actionWithAnimation:animObject6];
id animAction7=[CCAnimate actionWithAnimation:animObject7];
id animAction8=[CCAnimate actionWithAnimation:animObject8];
id animAction9=[CCAnimate actionWithAnimation:animObject9];
id animAction10=[CCAnimate actionWithAnimation:animObject10];
id animAction11=[CCAnimate actionWithAnimation:animObject11];
id animAction12=[CCAnimate actionWithAnimation:animObject12];
id animAction13=[CCAnimate actionWithAnimation:animObject13];
id animAction14=[CCAnimate actionWithAnimation:animObject14];
//animAction=[CCRepeatForever actionWithAction:animAction];
CCSequence *moveAction = [CCSequence actions:animAction,animAction1,animAction2,animAction3,animAction4,animAction5,animAction6,animAction7,animAction8,animAction9,animAction10,animAction11,animAction12,animAction13,animAction14,nil];
moveAction.tag=100;
[equ runAction:moveAction];