Assets Not Stretching

Running a newer version of GoDot, one thing that you have to do as well to have the images scale along with the viewport size change is in Display->Window->Stretch-> Set Mode to viewport.

That will have the assets scale along with the viewport as demonstrated in the video.

1 Like

I was wondering if there is / or what is the difference between viewport and canvas_item view on stretch mode. I did both and notice no difference if someone could explain difference would be nice. Thank You

If you hover over “Mode” in that menu (the label, not the field), a tooltip explains what each mode does (you can do this for anything btw, in the Inspector too). My understanding is that the mode indicates exactly what will be stretched: the actual assets, or the viewport.

The difference comes in how “half a pixel” is handled. With canvas_items mode, it isn’t handled very well because sprites are quantized (they’re discrete in the mathematical sense of the word); you simply can’t have half a game pixel because such a concept doesn’t exist for them. As a result, you can end up with the occasional scanline in your assets due to rounding errors, sort of like an old Atari console (these are the “scaling artifacts” that the tooltip mentions).

By comparison, the viewport mode can handle “half a pixel” much better because your monitor is not quantized like this; it can just adjust a screen pixel’s colour to soften any edges. This is my interpretation of it all; maybe it’s not 100% accurate, but this is more or less what’s going on.

1 Like

thank for the explanation much appreciate

1 Like

Privacy & Terms