2

I am making a game in SpriteKit for macOS using Swift, and due to my pixel art style, my SpriteKit scene has a size of 384 x 216, and I have relied on my scale mode to fix everything in fullscreen.

I realize that my pixel art becomes blurry with this, so I manually set all of my sprites to have nearest neighbor filtering, and that has worked so far.

The problem is, this gets very tedious, and I now have a SKLabelNode that uses a pixel font, and shows up blurry when in fullscreen. SKLabelNodes don't have an option for nearest filtering as far as I am concerned, and I am wondering if it would be possible to instead of changing textures to nearest neighbor, set it so the scene scales with no filtering at all?

Iman Nia
  • 2,255
  • 2
  • 15
  • 35
  • Did you try turning off anti aliasing? – Knight0fDragon May 25 '18 at 11:44
  • How do you do that in swift? –  May 25 '18 at 17:15
  • Whatever you do, do not set a specific width in your SKScene. This leads to some very wonky scaling issues. You want to get an application that will scale up your pixel art to look good on the unset scene size. (GIMP is highly recommended) – E. Huckabee May 28 '18 at 09:39
  • @E.Huckabee that is terrible advice. It is actually preferred to set a specific width to your SKScene. and use the .resizeFill scalemode for pixel/point accuracy. – Knight0fDragon May 29 '18 at 17:46
  • Looks like there isn't a simple way to turn off anti aliasing from what I can find, see this answer for some assistance https://stackoverflow.com/questions/36788246/how-to-disable-anti-aliasing-in-sklabelnode – Knight0fDragon May 29 '18 at 17:48
  • You may also be able to turn your font into a path, apply it to an SKShapeNode, and then turn off antialias – Knight0fDragon May 29 '18 at 17:50
  • https://stackoverflow.com/questions/11172207/get-path-to-trace-out-a-character-in-an-ios-uifont/11172565 – Knight0fDragon May 29 '18 at 17:53

0 Answers0