iphone – Coco2d – 使用CCBitmapFontAtlas
我正在尝试使用COCO2d创建一个简单的游戏但到目前为止没有运气…
当我试图创建一个CCBitmapFontAtlas我得到一个错误说: “_OBJC_CLASS _ $_ CCBitmapFontAtlas”,引自:“ 并且 : “’CCBitmapFontAtlas’已被弃用” 这是我的头文件: @interface MainMenuScene : CCLayer { >(id)场景; @结束 这是我的实现文件: #import "MainMenuScene.h" @implementation MainMenuScene >(id)场景 } – (id)init 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 [super dealloc]; 我用继承人创建了.FNT文件和.PNG文件 解决方法
你想要
CCLabelBMFont而不是CCBitmapFontAtlas.
startNewGameLabel = [CCLabelBMFont labelWithString:@"New Game" fntFile:@"bitmapfont.fnt"]; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |