2012-08-08 3 views
0

게임을 만들면서 지침 클래스에 지침이 포함 된 레이블을 만들었습니다.내 지침에 내 레이블이 인쇄되지 않는 이유를 알아낼 수 없습니까?

그러나 게임을 실행할 때 지침이 인쇄되지 않습니다. 이유를 알아 내는데 어려움을 겪고 있습니다.

나를 도와 줄 수있는 도움을 주셔서 감사합니다.

#import "Instructions.h" 
#import "MainMenu.h" 

@implementation Instructions 

+ (CCScene *) scene 
{ 
    CCScene * scene = [CCScene node]; // scene is an autorelease object 
    Instructions * layer = [Instructions node]; // later is an autorelease object 
    [scene addChild: layer]; // add layer as a child to scene 
    return scene; // return the scene 
} 

- (id) init 
{ 
    if ((self = [super init])) 
    { 
     [ self how ]; 
    } 
    return self; 
} 

- (void) how 
{ 
    // Create the label 
    CCLabelTTF *label = [CCLabelTTF labelWithString:@"The object of this game is for kangaroo Leo to collect various berries by jumping and running through obstacles in order to unlock other kangaroos and the worlds in which they live." fontName:@"Consolas" fontSize:16]; 

    // Position it on the screen 
    label.position = ccp(160,240); 

    // Add it to the scene so it can be displayed 
    [self addChild:label z:0]; 

} 
@end 
+0

는 "마커 펠트"와 같은 빌드에서 글꼴을 사용하여 동일한 문제가 있습니까? 또한 텍스트와 BG에 동일한 색상을 사용하고있을 가능성이 있습니까? – yannicuLar

답변

0

Consolas가 iOS에서 사전 설치되어 있지 않습니다. Ether은 Arial과 같은 기본 글꼴을 사용하거나 Consolas.ttf 파일을 프로젝트에 넣습니다. .ttf 파일을 추가 한 후 info.plist로 이동하여 응용 프로그램에서 제공하는 키 글꼴이있는 새 행을 추가하십시오. Consolas.ttf도 추가하십시오. 유래에 http://tetontech.wordpress.com/2010/09/03/using-custom-fonts-in-your-ios-application/

또는 여기 : 사용자 정의 글꼴 방문을 추가하는 자세한 지시를 들어

Can I embed a custom font in an iPhone application?

관련 문제