我正在为使用cocos2d的图形制作iPhone应用程序,并且向我的项目添加了4张图片,我想叠加以用作背景。我然后让他们这样CCSprites它们添加到应用程序...CCSprite降低性能
background.sun = [CCSprite spriteWithFile:@"SunLayer.png"];
[self addChild:background.sun z:-1];
background.mountain = [CCSprite spriteWithFile:@"MountainLayer.png"];
[self addChild:background.mountain z:-1];
background.tree = [CCSprite spriteWithFile:@"TreeLayer.png"];
[self addChild:background.tree z:-1];
background.hill = [CCSprite spriteWithFile:@"HillLayer.png"];
[self addChild:background.hill z:-1];
background.hill.position = ccp(s.width/2, s.height/2);
background.sun.position = ccp(s.width/2, s.height/2);
background.mountain.position = ccp(s.width/2, s.height/2);
background.tree.position = ccp(s.width/2, s.height/2);
这使我的帧速率下降到30!从60!我怎么能保持一个好的帧率,但添加这些精灵!谢谢你
这在它自己不应该降低帧率。你只调用一次这个代码吗?这些图像特别大吗? – 2012-03-04 18:17:23
这些图像全部占据了整个屏幕 – 2012-03-04 19:29:23