I am trying to create a simple game with COCO2d, but so far no luck ... when I try to create CCBitmapFontAtlas, I get an error message:
"_ OBJC_CLASS _ $ _ CCBitmapFontAtlas" referenced by: "
and:
"'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) scene {CCScene scene = [CCScene node]; CCLayer level = [MainMenuScene node]; [scene addChild: layer]; return scene;
}
- (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;
}
I created the .FNT and .PNG file with the heir
Yaniv source share