GMS 2 Sprite Downscaling

Ihcaris

Member
Been trying to figure out a good way to handle this but I've only got one idea left.

Basically I've got a pixel art game and wanted to use high res character art for things like dialogue which is drawn on the GUI layer set at a higher resolution. The issue is when it comes time to downscale the game from anything less than the image was intended for, the downscaled image looks a little jagged. It's not terrible to be fair but it also never looks as good as it should compared to the resolution it was meant to be viewed at. Is there any way to improve how GMS handles downscaling of sprites at all? Enabling interpolation helps but that then ruins the pixel art. Is there a way to use interpolation only for the high res sprites maybe? The only solid thing I could think of to fix it is to just have say two or three versions of every sprite, each at a different size and just use whichever of them would best suit the current screen size without downscaling. I've also tried setting up a new surface to draw on instead but that just gave the same results as the GUI layer.

If push comes to shove I can always just scrap the high res art and make it all pixel art as well but I'd like this to work if possible.
 

AndreFS

Member
I don't have many ideas
but it could be the vision.
If the game view is small, large resolutions will lose quality.
So see if your view has a great size.

I'm sorry if I don't help you
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
You can try enabling and disabling interpolation as required? Enable it for drawing the GUI and then disable it when not... you can use the Draw Gui Begin and End events in a controller for this, perhaps? So, enable interpolation in the GUI begin, then draw all the GUI elements in the main GUI event, then disable interpolation in the Gui End event. If you don't want to enable interpolation for the entire GUI, then you can also enable and disable it before and after drawing specific sprites. https://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/drawing/gpu/gpu_set_texfilter.html
 

Ihcaris

Member
You can try enabling and disabling interpolation as required? Enable it for drawing the GUI and then disable it when not... you can use the Draw Gui Begin and End events in a controller for this, perhaps? So, enable interpolation in the GUI begin, then draw all the GUI elements in the main GUI event, then disable interpolation in the Gui End event. If you don't want to enable interpolation for the entire GUI, then you can also enable and disable it before and after drawing specific sprites. https://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/drawing/gpu/gpu_set_texfilter.html
Oh wow now I feel dumb. I did see that function while looking over the manual for things on interpolation but I'd written it off without even trying it because I assumed turning it on would just immediately switch it on for everything currently on the screen. Didn't even cross my mind to try it.

Thank you!
 
Top