filter(GRAY) makes everything gray

In my game I am trying to make a button grayscale (temporarily) but not anything else. But it seems that there is no way to disable a filter after it is applied?

if (!button.pressable) filter(GRAY);

This is supposed to make the just the button gray (for some reason its also supposed to go after the button render??)

The code is at the end of the entire draw loop and it is also surrounded by push & pop style. I don’t understand why this works like this…

Try button.filter(GRAY); It may be the problem but not 100% sure without seeing the rest of the code, if that doesnt work either try

if (!button.pressable) button.filter(GRAY);

hopefully one of them works

1 Like