tags:

views:

100

answers:

1

Hey. Here's my code with I use to create sprite thanks to cocos2d.

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"bambusowy.plist"];
  CCSpriteSheet *teksturySheet = [CCSpriteSheet spriteSheetWithFile:@"bambusowy.png"];
  [self addChild:teksturySheet];



   NSString * stttt = [NSString stringWithUTF8String: tex_dane[mapa1[i][0]].c_str()];


   CCSprite *teksturka = [CCSprite spriteWithSpriteFrameName:stttt]; 

This code works fine on the Simulator, but it crash on the device. Here are the logs:

Tue Aug 10 15:36:39 unknown menu panda[1271] : * Assertion failure in -[CCSprite initWithTexture:rect:], /Users/.... libs/cocos2d/CCSprite.m:183

Tue unknown menu panda[1271] : * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid texture for sprite'

I guess the problem is that it cant select texture from an atlas...

A: 

I am trying to find an answer to this question as well. It seems any texture larger than 1024 x 1024 will crash on iPhone 3Gs, could that be the case for you as well? I've reduced the size of my textures and they run OK now.

aeldron