Reputation: 73
I'm new to Xcode so please be patient with me! :)
(using Swift 2.1, OSX 10.11.2 El Capitan and Xcode 7.2 I am not using sprite kit or anything like that, I'm just using a single page application)
I'm trying to make a pixel art game but whenever I create a UIImageView and set the image to my pixel art png file, it makes the image all blurry, here is a screenshot of it:
as you can see in the Preview window (right) the image is crisp and clean, and in the Xcode window (left) the image is blurry and fuzzy
Can someone please tell me how to fix this?
Upvotes: 3
Views: 1260
Reputation: 1155
In swift 5 you can do the following to change the filtering mode:
texture?.filteringMode = SKTextureFilteringMode.nearest
This will disable anti-aliasing for the selected texture.
Upvotes: 1
Reputation: 756
This should not be an issue.
You can also turn off the PNG Compression. How can I skip compressing one PNG?.
It is possible that the alpha channel is messing it up so try saving as a 24 bit PNG no Alpha or even better 8bit PNG no Alpha.
Upvotes: -2