Now that we have a world displayed, let's welcome it! Refer to the following steps:
Open the
FirstScene.m
file and add the following code in theinit
method, right after the[self addChild:earth];
line.//1 CCLabelTTF* welcome = [CCLabelTTF labelWithString:@"Hello!" fontName:@"Helvetica" fontSize:32]; //2 welcome.position = ccp(winSize.width / 2.0f, winSize.height * 0.9f); //3 [self addChild:welcome];
Build and run the project.
You should see the Hello! label at the top half of the screen. Refer to the following screenshot: