小编Yan*_*niv的帖子

Coco2d - 使用CCBitmapFontAtlas

我正在尝试使用COCO2d创建一个简单的游戏,但到目前为止没有运气......当我正在尝试创建CCBitmapFontAtlas时,我收到一条错误消息:

"_OBJC_CLASS _ $ _ CCBitmapFontAtlas",引自:"

并且 :

"'CCBitmapFontAtlas'已被弃用"

这是我的头文件:

@interface MainMenuScene : CCLayer 
Run Code Online (Sandbox Code Playgroud)

{CCBitmapFontAtlas*startNewGameLabel; }

  • (id)场景;

@结束

这是我的实现文件:

#import "MainMenuScene.h"
Run Code Online (Sandbox Code Playgroud)

@implementation MainMenuScene

  • (id)scene {CCScene scene = [CCScene node]; CCLayer layer = [MainMenuScene node]; [scene addChild:layer]; 回归场景;

}

- (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;
Run Code Online (Sandbox Code Playgroud)

}

  • (void)dealloc …

iphone xcode objective-c cocos2d-iphone

4
推荐指数
1
解决办法
2110
查看次数

标签 统计

cocos2d-iphone ×1

iphone ×1

objective-c ×1

xcode ×1