私はゲームを作成していて、インストラクションクラスで、インストラクションを含むラベルを作成しました
ただし、何らかの理由で、ゲームを実行すると、指示が印刷されません。私はその理由を理解するのに非常に苦労しています。
あなたが私に提供できるどんな助けにも感謝します!
#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