I'm a cocos2D newb and loving it so far. I'm having a little difficulty with CCSpriteFrameCache though with a sprite sheet which I generated using Zwoptex. I have a 256x256 .png texture with an associated .plist (Objects.png & Objects.plist). When I try to setup the CCSpriteFrameCache, I get an assertion and a complete crash. MainGUI is a class that subclasses CCLayer. I'm at a loss and can't figure out what's going wrong...almost all the samples I come across seem to be setup exactly the same. I have added both the .png and the .plist to my project.
#import "MainGUI.h"
@implementation MainGUI
-(id) init
{
self = [super init];
if( self != nil)
{
// Create a black transparent shelf
CCColorLayer *colorLayer = [CCColorLayer layerWithColor:ccc4(0, 0, 0, 170) width:640 height:34];
[self addChild:colorLayer];
// Create the spritesheet for the gui
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"Objects.plist"];
CCSpriteSheet *guiSpriteSheet = [CCSpriteSheet spriteSheetWithFile:@"Objects.png"];
[self addChild:guiSpriteSheet];
}
return self;
}
@end
The CCColorLayer works fine. The Assertion info that I get is:
2010-09-02 22:13:37.794 MyProject[6372:207] *** Assertion failure in -[CCSpriteFrameCache addSpriteFramesWithDictionary:texture:], /Users/someuser/Documents/StarGazer/libs/cocos2d/CCSpriteFrameCache.m:111
2010-09-02 22:13:37.796 MyProject[6372:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'cocos2d: WARNING: format is not supported for CCSpriteFrameCache addSpriteFramesWithDictionary:texture:'
Any help would be GREATLY appreciated. Thanks.