我正在创建一个游戏,在我的说明类中,我创建了一个带有说明的标签
但是,由于某种原因,当我运行我的游戏时,指令不会打印出来。我很难弄清楚为什么。
感谢您为我提供的任何帮助!
#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