ios原生游戏开发
3. createSceneContents - (void)createSceneContents
{ self.backgroundColor = [SKColor blueColor];
self.scaleMode = SKSceneScaleModeAspectFit;
[self AddChild [self newHelloNode];
}
SKColor color
SKColor iOS UIColor OS X
NSColor
: scale : :
(letterboxing)
4. newHelloNode - SKLabelNode * newHelloNode
{
SKLabelNode * helloNode = [SKLabelNode labelNodeWithFontNamed:@“Chalkduster”];
@helloNode.text =“Hello, World ”;
helloNode.fontSize = 42;
helloNode.position = CGPointMake(CGRectGetMidX(self.frame) CGRectGetMidY(self.frame)) return helloNode;
}