DShaar
DShaar

Reputation: 165

SKLabelNode not appearing on actual device

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

Answers (1)

aaazalea
aaazalea

Reputation: 7910

Try converting the font from a TTF to an OTF.

Upvotes: 2

Related Questions