Is setting a SKScene's size to a multiple of the bounds of SKView a good idea?


I have a SKView that’s presenting a SKScene. The scene contains a camera and several SKLabelNodes (there are more things, but the labels are my main concern). At first, I created my scene like this(bounds are the bounds of the SKView):

let gameScene = MyGameScene(size: CGSize(width: bounds.size.width, height: bounds.size.height))

That lead to one big problem: All of the labels are pretty blurry (regardless of the font size, an insanely big label only slightly gets sharper). It worsens when I zoom in using the camera (camera.setScale() or an action).

To fix this, I thought about doing this:

let gameScene = PlanetOrbitScene(size: CGSize(width: bounds.size.width * 4, height: bounds.size.height * 4))

I increased the size of the scene. As I use a camera (and the scene scales it to fit the screen) it doesn’t change anything, except that I now have more pixels/points to use inside my scene. This way, everything is extremely sharp and looks awesome, even if I zoom in.

Is this a valid approach? Or can’t you do this? I’m not sure if there are disadvantages.

I’d appreciate any thoughts on this. Than you very much


This topic was automatically closed after 166 days. New replies are no longer allowed.