내가 COCO2d와 간단한 게임을 만들려고 해요하지만 난이 CCBitmapFontAtlas을 만들려고 할 때 운이 지금까지 ... 내가 말하는 오류를 얻을 :Coco2d - 사용 CCBitmapFontAtlas
"_OBJC_CLASS _ $ _ CCBitmapFontAtlas "에서 참조 :"또한
과 :
01 :여기
내 헤더 파일은 " 'CCBitmapFontAtlas'는 사용되지 않습니다"{ CCBitmapFontAtlas * startNewGameLabel; }
- (id) 장면; 여기 @end
및
내 구현 파일입니다
#import "MainMenuScene.h"
@implementation MainMenuScene
- (ID) 장면 { CCScene 장면 = [CCScene 노드] ; CCLayer 레이어 = [MainMenuScene 노드]; [scene addChild : layer]; 반환 장면;
}
- (ID)를 초기화하기 { 경우 ((자기 = 슈퍼 INIT])) { CCLOG ("%의 @ %의 @"@ NSStringFromSelector (_cmd) 자체); [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;
}
(공극) 할당 해제 { CCLOG ("%의 @ %의 @"@ NSStringFromSelector (_cmd) 자체);
[슈퍼 dealloc]; }
내가 뭔가를 가져와야합니까? 왜냐하면 xCode가 CCLabelBMFont를 인식하지 않기 때문입니다. 또 다른 이유는 CCBitmapFontAtlas가 작동하지 않는 이유입니다. 나는 다른 코드를 보았고 모든 것이 내 것과 같다. – Yaniv
최신 버전의 cocos2d를 사용하고 있습니까? 0.99.5? 그것은 나를 위해 잘 작동합니다.CCBitmapFontAtlas가 오래되었습니다. 버전 0.99.5에서는 CCLabelBMFont를 사용해야합니다. – badgerr
하지만 오류가 발생했습니다 : 'NSInternalInconsistencyException', 이유 : '스프라이트의 텍스처가 잘못되었습니다.'제발 도와주세요. –