Recently I’ve been testing out my 64*64 pixel art with the pythonista scene module (which I’m more comfortable using).
I have been able to get clear images by individually setting the filtering mode of each imported image to FILTERING_NEAREST, which is a very tedious process.
Is there a way of setting the filtering mode of all the images in the whole scene to FILTERING_NEAREST, preferably in one line?
Here’s a short example of my current code:
import scene
from scene import *
x,y = get_screen_size()
class MyScene(Scene):
def setup(self):
self.background_color = '#000000'
self.pixel = Texture('GameAssets/lizard_profile.png')
self.pixel.filtering_mode=FILTERING_NEAREST #imagine copying this for every image. very tedious. but it is the only method that i know which actually works.
self.pixelNode = SpriteNode(self.pixel)
self.pixelNode.position = (x/2,y/2)
self.pixelNode.size = self.pixelNode.size*6 #makes the 64*64 pixel art more visible.
self.add_child(self.pixelNode)
def update(self):
filtering_mode=FILTERING_NEAREST #this does not work.
scene.filtering_mode=FILTERING_NEAREST #this also does not work.
scene.run(MyScene(),orientation=LANDSCAPE,frame_interval=1, anti_alias=False, show_fps=True, multi_touch=True)
If there are no convenient methods for doing this, I’ll have to rescale my images at a higher resolution (although I’d prefer to stick with 64*64 PNGs due to the smaller file sizes).