使用 SKLabelNode 显示随机文本

Displaying random text using SKLabelNode

我是这个精灵的新手 kit.I 想显示文本 randomly.Actually 我有 3 个词 我需要随机显示这 3 个词 SKLabelNode.I 不要知道如何实现 this.Let 我们采取空运、陆运和海运这 3 个词应该随机显示。请提前帮助我解决这个问题 issue.Thanks。

 SKLabelNode  * scoreLbl =  [SKLabelNode labelNodeWithFontNamed:@"Futura-Bold"];
[scoreLbl setText:@"Sea"];



[scoreLbl setFontSize:50*_distanceMultiPlayer];


[scoreLbl setPosition:CGPointMake(scoreLbl.position.x, scoreLbl.position.y + (10 *_distanceMultiPlayer) )];
scoreLbl.fontColor=[UIColor blueColor];
[scoreLbl setFontSize:12.0];
[self     addChild:scoreLbl];
[scoreLbl setName:@"scoreLabel"];
scoreLbl.text = @[@"Air", @"Land", @"Sea"][arc4random() % 3];

我得到 answer.I 我的代码是 scoreLbl.text= @[@"Air", @"Land", @"Sea"][arc4random( ) % 3];

感谢大家帮助我