How to avoid a smooth effect in SpriteKit?

I work with very small sprites to create a retro game with pixel sprites. But when I zoom in on my sprites to make them bigger, the Sprite Kit smoothes out the sprites, and that’s not what I want.

Is there a way to save a sprite pixel when I zoom in?

+4
source share
2 answers

You can play in the filtering mode .Nearest textures (by default -.Linear). Texture filtering modes can be used when a texture is drawn at a size other than its own size.

SKTextureFilteringNearest

. , .

, .

, ( .Nearest)

+3

. , .

- , .

+2

Source: https://habr.com/ru/post/1626752/


All Articles