Forum Archive

How to use filtering__mode for Texture?

TheClingyFox

So long story short I saw this post and it made me realize that I wanted to use low resolution sprites because of how easy they are to make. I got a hold of using subtexture but I can't seem to get filtering_mode to work. Can someone give an example?

P.S. This is in the context of the scene module. Also I am new to Python. Thanks for helping me out!

omz

Congrats, you found a bug! ;)

In short, the FILTERING_NEAREST constant is defined incorrectly, so it actually has the same value as FILTERING_LINEAR (the default). As a workaround, just set the filtering_mode attribute to 1 instead of using the named constant. This will continue to work, even when the bug is fixed in the next update.

One more thing: If you're working with subtextures, you need to set the filtering_mode for each subtexture separately; the main texture's mode has no effect on subtextures that are created from it.

TheClingyFox

Oh my gosh you're a life saver Omz. Thank you!

ellie_ff1493

When’s this bug getting fixed?
Just spent a week trying to find the bug in “my” code