Reputation: 165
I am writing a spriteKit program in swift and want to have a score label in the corner of my screen, so that the user can monitor their points. I have the following code:
var scoreLabel = SKLabelNode()
.
.
.
init(size:CGSize)
{
super.init(size)
scoreLabel = SKLabelNode(fontNamed:"TechnoHideo")
scoreLabel.text = "0"
scoreLabel.fontSize = 40
scoreLabel.fontColor = UIColor.whiteColor()
scoreLabel.position = CGPointMake(200, 200)
self.addChild(scoreLabel)
}
I only included relevant code in this sample. So here is the weird part. This code works fine on the simulator, but the label does not show up on my actual iPad. The font is a custom font. I added its ttf file to the project, made sure it was in the build phases->copy bundle resources and made sure that it was under info->Fonts provided by application. Any ideas as to what is going wrong?
Upvotes: 1
Views: 358