简体   繁体   English

LabelNode字体在设备上不起作用

[英]LabelNode font doesn't work on device

labelNode working on similator with font i selected.But It doesn't work on my real device iPad. labelNode正在使用我选择的字体在模拟器上工作,但是在我的真实设备iPad上不起作用。 And It loading with delay on device. 而且它会延迟加载到设备上。 It works so nice on simulator. 它在模拟器上很好用。

-(void)setupUI
{
SKLabelNode *scoreLabel = [SKLabelNode labelNodeWithFontNamed:@"Bloody"];
scoreLabel.fontColor = [SKColor redColor];
scoreLabel.fontSize = 20.0;
scoreLabel.text = @"SCORE: 0";
scoreLabel.name = @"scoreLabel";
scoreLabel.verticalAlignmentMode = SKLabelVerticalAlignmentModeCenter;
scoreLabel.position = CGPointMake(self.size.width/2, self.size.height scoreLabel.frame.size.height);
[self addChild:scoreLabel];
}

The reason why it's not working is that you are trying to use a custom font, which is not available on device. 它不起作用的原因是您尝试使用自定义字体,该字体在设备上不可用。 You need to add the font to the project. 您需要将字体添加到项目中。 Check this answer: Custom Fonts in Xcode 5 . 检查以下答案: Xcode 5中的自定义字体 You will need to add the font file to the project and also it's information in info.plist. 您将需要将字体文件添加到项目中,其信息也位于info.plist中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM