Scale down(or up) the player window automatically

Godot Version

4.2.1

Question

I am working on a mobile game in landscape mode, resolution x720-y1280.
When I play the scene the window opens with a big part of it offscreen because my monitor is only 1080p. Is there a way in which I can maintain the resolution of the game but have the player window scale down automatically to something like 480p, so that it doesn’t go offscreen?

what’s your project settings window’s resolution?

width is 720, height is 1280, height goes offscreen.

set the project settings to this
image

In General Tab → DisplayWindow

I have that already. My current problem is that when the player window opens it opens with the original resolution, and because of that it will go off screen. I then have to resize the window manually to fit my own monitor resolution. I want to know if there is a way that the window can initialize automatically with a smaller resolution so that it doesn’t go off screen

so you are talking about Window of Window — Godot Engine (stable) documentation in English doesnt respect project settiings’ resolution?

It respects the project resolution and that’s why it goes off screen.
My monitor height is 1080p, the project’s height is 1280p. I want to maintain the project resolution at 1280p, but what I want is the runtime window to open automatically at a smaller resolution so that it doesn’t go off screen while I test the game.

the expand

should have already handled it, so the game stuffs always inside the screen

unless you purposely added a node outside the resolution area

I took out all the nodes and just left the main scene node, still getting the same problem. In a previous Godot version the project settings had windows resolution, and then it also had something called ‘test width’ and ‘test height’ which would do precisely what I am trying to do, but that setting is not on godot 4 anymore it seems

Zdr, thank you very much for trying to help me with this problem.
Through luck I was able to find the solution. Here it is for anyone with that might face such an issue. To Override the Project resolution on the window, turn on ‘Advanced Settings’ on the top right corner of the project setting window, once you it will show you these two options “window width override” and “window height override”. This will solve it

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.