2012-08-08 10 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 2012-08-23 21:21:47

回答

0

Consolas未预先安装在iOS上。以太网使用默认字体,如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?

相关问题