i'm trying to create a simple game with COCO2d but no luck so far... when i'm trying to create a CCBitmapFontAtlas i get a error saying :
"_OBJC_CLASS_$_CCBitmapFontAtlas", referenced from:"
and also :
"'CCBitmapFontAtlas' is deprecated "
here is my header file:
@interface MainMenuScene : CCLayer
{ CCBitmapFontAtlas* startNewGameLabel; }
@end
and here is my implementation file :
#import "MainMenuScene.h"
@implementation MainMenuScene
}
-(id) init { if ((self = [super init])) { CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self); [self setVisible:YES];
startNewGameLabel = [CCBitmapFontAtlas
bitmapFontAtlasWithString:@"New Game"
fntFile:@"bitmapfont.fnt"];
//[CCLabelTTF labelWithString:@"New Game"
// fontName:@"AppleGothic"
// fontSize:48];
CGSize size = [[CCDirector sharedDirector] winSize];
startNewGameLabel.position = CGPointMake(size.width / 2, size.height / 2);
[self addChild:startNewGameLabel];
}
return self;
}
(void) dealloc { CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
[super dealloc]; } @end
I created both .FNT file and .PNG file with heir
You want CCLabelBMFont instead of CCBitmapFontAtlas.
startNewGameLabel = [CCLabelBMFont
labelWithString:@"New Game"
fntFile:@"bitmapfont.fnt"];
Use CCLabelBMFont instead. Will be removed 1.0.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With