You need to preload the font so that when you first call your SKScene sprite kit, the font in memory is already ready. The best way to do this is to either use the application delegate or the singleton as soon as you can in the game life cycle.
self.scoreLabel = [SKLabelNode labelNodeWithFontNamed:@"Futura"]; self.scoreLabel.text = @"preload";
You donβt need to make the shortcut global, just make sure you keep a strong link so that the compiler knows that you want to keep the font in memory. Also make sure that you set the text property (the font only loads when it is installed).
EDIT:
This is what I use:
- (void)setupFonts { SKLabelNode *preloadFontLabel = [SKLabelNode labelNodeWithFontNamed:@"HelveticaNeue-UltraLight"]; [preloadFontLabel setText:@"Preload"]; }
This is called from singleton game assets right when the game starts, I also have a callback that stops the βPLAYβ button that appears before loading the assets, so the user cannot jump from the gun until everything is up and loaded. My game resources take only 1.03 seconds. Therefore, this is not a problem, but if necessary, you can hide a large load behind the splash / launch screen.
If you still see the problem, I would check that you do not have other fonts in your SKScene that you did not preload. There may also be a problem loading a custom font, try changing the font to "HelveticaNeue-UltraLight" and see if you get the same problem.
source share