Hi, first post here. Just started using cocos2d after nightmares trying to compile openFrameworks onto iPhone, and it works wonderfully. I am figuring out components of c2d that I expect to need when I start developing a game proper (I have one in mind).
At the moment I am having some probably easy to resolve trouble with AtlasSprite and/or AtlasSpriteManager. From reading the forum I have gathered that this should work: (Note: I have had no trouble with the ordinary Sprite object, and am just trying to understand AtlasSpriteManager so that I can use it in the game proper.)
AtlasSpriteManager* mgr = [AtlasSpriteManager spriteManagerWithFile: @"bslogo.png"];
AtlasSprite* sprite = [AtlasSprite spriteWithRect: CGRectMake( 0, 0, 424, 67 ) spriteManager: mgr ];
CGSize size = [[Director sharedDirector] winSize];
sprite.position = ccp( size.width/2, size.height/2 );
[mgr addChild: sprite z: 1 ];
[self addChild: sprite z: 1 ];
This builds fine, but when I try to run it I get a SIGABRT response from my device. If I remove the [mgr addChild... line, the app builds AND runs fine, but the sprite doesn't appear. Apparently the [mgr addChild... line is required to display sprites correctly, but if it doesn't work...?
Thanks in advance