Fullscreen mode stretches viewport too much

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Socrates

I sort of asked this question a few days ago but have narrowed down what is wrong. When in any kind of windowed mode the game displays correctly, but in fullscreen mode the screen is stretched too much so that it cuts off part of the image (exactly 20% i believe). I am fairly certain I’ve tried every possible combination of settings but the problem always persists and is always exactly the same when i set it to fullscreen mode. The only workaround I can think of would be to use a different camera with different zoom settings depending on if the game is in fullscreen or windowed mode, but that’s clearly not how this is supposed to work. Here are images of the problem, the top is windowed mode displayed correctly, the bottom is fullscreen with much of the image cut off: Imgur: The magic of the Internet

:bust_in_silhouette: Reply From: Bartosz

It will be hard to find solution without test scene to reproduce problem.
By looking at your image I would say that fullscreen resolution is not wide enough to fit whole viewport, it keeps height but cuts on the sides.
Try setting aspect to keep_width

I tried creating a test project, but really any project I create will do this, even if the project just displays a single sprite. Also it’s not keeping the height either, both the width and height are reduced by 20%, so it seems to be displaying 1536 x 864 of the original 1920 x 1080 image (I arrived at that percentage by measuring how much larger the squares with the numbers are than they should be). The only thing I can think of is that godot is detecting the wrong resolution for my monitor (which is 1920 x 1080, I checked multiple times/ways) and is trying to stretch the image to fit.

EDIT: Just realized after writing this that I could see what godot is actually doing with OS.get_screen_size() so i put that in and it tells me that the screen is 1536 x 864.

Socrates | 2018-03-29 03:14

:bust_in_silhouette: Reply From: Socrates

Okay I sort of solved this in a sort of bad way and am posting this if anyone else has the same issue. The issue is that Windows’ display scale on my laptop was not set to 100% (which makes everything pretty tiny) but it fixes the problem. So I guess I’ll just squint till I find a better computer :confused:

EDIT: Found this issue which has good suggestions to help anyone else with the problem: Display issues on 4k screen when using fullscreen mode at lower than native resolution · Issue #14446 · godotengine/godot · GitHub

2nd EDIT: The correct answer is to set Allow Hidpi to true. Apparently that’s just what that does :confused: