Reputation: 1852
I am having trouble with transition when using custom ttf fonts for spritekit in swift.
I realized that when I use the code below my app gets laggy and slow for only the first time. Are there any way to fix this issue? Are there any examples or tips?
let loadLabel = SKLabelNode(fontNamed:"Silom")
loadLabel.text = "Loading ....."
loadLabel.fontSize = 30
loadLabel.fontColor = SKColor.whiteColor()
//loadLabel.position = CGPoint(x:self.size.width/2, y: self.size.height/2 )
loadLabel.zPosition=2
Upvotes: 2
Views: 542
Reputation: 13665
As pointed already, if the font name is misspelled, a loading delay can occur. But, the name of the font you pass when creating SKLabelNode is not necessarily the same as the filename of the font. You can use Fontbook to find the actual font name or you could do something like this:
for family: String in UIFont.familyNames()
{
print("\(family)")
for names: String in UIFont.fontNamesForFamilyName(family)
{
print("== \(names)")
}
}
After you find a font name, remember to remove this code snippet from your project.
Also, make sure that you have:
Upvotes: 2