开发者

Cocos2d framework (iPhone): loading 100 frames causes problem

I am developing application in cocos2d framework 0.99.

I have 100 images for animation, the image is big so it's difficult to load 开发者_JAVA百科how can I get those image catche once and use in the application.

I am using following code:

CCAnimation *walkingAnimation = 
    [CCAnimation animationWithName:@"Flying Animation" delay:1.0f/10];

for (int i=1;i<26;i++) {
    [walkingAnimation addFrameWithFilename:
         [@"night"stringByAppendingString:
             [NSString stringWithFormat:@"%i.png",i]]];
}

CCAnimate *walk = [CCAnimate actionWithAnimation:walkingAnimation];

Anyone knows please help.


You should try using texture atlases. I can't remember Cocos atlas class, but it should be something like CCSpriteAtlas

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜