0

Could somebody please let me know what to do to make an SKLabelNode font size adjust to all screen sizes. I dont mean answers such as checking the device first e.g. if UIDevice....

If you create a new Xcode project with the SpriteKit game template the HelloWorld Label adjusts perfectly to all screen sizes.

However in my own projects my SKLabelNodes do not adjust their fontSize automatically, so the HelloWorld label on a iPhone 5 would be way bigger or on an iPad it would be way to small. I have a helper at the moment that helps me convert those but I would prefer to go for a native solution like the sample project.

Has it got something to do with the .sks file or storyboard? I use neither but than neither does the sample project.

I am very curios about this and would appreciate any help or support.

Thank you

crashoverride777
  • 10,581
  • 2
  • 32
  • 56

1 Answers1

0

It just turns out to be the different scene scaleModes available. I haven't played around with them too much yet. My games all use .ResizeFill to ensure that the scenes are not cropped but as a result I have to adjust my labels/ sprites sizes accordingly. The sample project uses .AspectFill which makes sure the labels/sprites are the same size but as a result your scenes may be cropped, which I dont want in my games.

I just posted my helper I use for adjusting my assest on GitHub, incase someone is interested.

https://github.com/crashoverride777/Device-Manager

crashoverride777
  • 10,581
  • 2
  • 32
  • 56