Search code examples
iosxcodeswiftsprite-kitscene

How to set texture filtering mode in spritekit scene editor?


I'm writing pixelart game with SpriteKit and I have a problem with setting texture filtering mode in scene editor in xcode. While I was setting my textures programmatically I used constructions like this:

texture.filteringMode = SKTextureFilteringMode.Nearest 

for correct pixel display.

But in scene editor I have only one property for texture

enter image description here

and I dont know how to set SKTextureFilteringMode parameter in this case


Solution

  • This is not doable in interface builder. You have to either set it programmatically or subclass SKTexure and make the new property "@IBInspectable" that will set SKTextureFilteringMode.