我试着用COCO2d创建一个简单的游戏,但到目前为止没有运气.当我试图创建一个CCBitmapFontAtlas时,我会看到一个错误:
"_OBJC_CLASS_$_CCBitmapFontAtlas",引用自:“
还包括:
"'CCBitmapFontAtlas‘不受欢迎“
以下是我的头文件:
@interface MainMenuScene : CCLayer { CCBitmapFontAtlas* startNewGameLabel;}
@end
这是我的实现文件:
#import "MainMenuScene.h"@implementation MainMenuScene
}
-(id) init { if ((self = super )){ CCLOG(@"%@:%@",NSStringFromSelector(_cmd),self);
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;}
我与继承人一起创建了.FNT文件和.PNG文件
发布于 2011-01-14 15:06:25
你想要CCLabelBMFont而不是CCBitmapFontAtlas。
startNewGameLabel = [CCLabelBMFont
labelWithString:@"New Game"
fntFile:@"bitmapfont.fnt"]; 发布于 2011-12-18 14:18:56
使用CCLabelBMFont代替。将被删除1.0.1
https://stackoverflow.com/questions/4692376
复制相似问题