1

I'm developing my first iOS game using Swift and Sprite Kit. Everything is working so far, but when testing in different devices with the simulator I discovered that the SKLabelNodes I'm using to show the score in the hud doesn't look good.

When testing in the iPad they look great, but in the iPhones the texts don't look very smooth, like pixelated.

The game is made for work in all devices using the scaleMode at .AspectFill, and perhaps that's the reason, but for everything else works just fine.

I have proved many font styles and always happens the same.

Anyone that have been through the same problem?

Here's the code with which I load the scene:

let scene = MainMenu(size:CGSize(width: 2048, height: 1536))
        // Configure the view.
        let skView = self.view as! SKView
        skView.showsFPS = true
        skView.showsNodeCount = true
        skView.showsPhysics = false
        skView.ignoresSiblingOrder = true

        scene.scaleMode = .AspectFill

        skView.presentScene(scene)

And the SKLabelNodes I create them this way:

let totalScoreLabel = SKLabelNode(fontNamed: "AvenirNext-Regular")
        totalScoreLabel.fontColor = SKColor(red: 0, green: 174/255.0, blue: 239/255.0, alpha: 1.0)
        totalScoreLabel.fontSize = 70
        totalScoreLabel.text = "Total score: \(GameState.sharedInstance.score)"
        totalScoreLabel.position = CGPoint(x: size.width/2, y: size.height/2)
        popUpLayer.addChild(totalScoreLabel)

Thanks

dpuertas
  • 23
  • 4

0 Answers0