+1 vote

Is it possible, in the editor, to make the play screen smaller (i.e. when testing with F5 or F6)?

I am developing a portrait game that should work with 1920x1200 resolution. However, this is taller than the screen I am developing on, so when pressing play, part of the screen is not visible.

I have looked through all the editor settings without joy, and on the project settings there are test_width and test_height options, but these don't cause the display to scale.

in Engine by (114 points)

4 Answers

0 votes
Best answer

OK, I think I got it.

In the project settings, I set stretch_mode to "viewport" and stretch_aspect to "keep". (I think I did this for my first test mobile game, come to think of it now).

by (114 points)
selected by
0 votes
by (1,468 points)
0 votes

If your game window is too large on your development pc, you can make it smaller by resizing the window via OS.set_window_size().

Play with the stretch_mode and stretch_aspect settings in Project Settings->Display to find which setting looks best.

by (1,314 points)
+1 vote

I know this is an old post, but I've been trying to get this to work and struggled using the project settings.

To get it to work for me, with a background of 1080 x 1920 in portrait mode, I did the following:

In Project settings/Display/Window - width = 540 Height = 960
Add a script to the base node (if you don't have one).

In the _ready() function add the line: get_tree().set_screen_stretch(2,1,Vector2(540,960),.5)

This is setting the shrink value in the display settings to .5, which you can't do in the editor (well not in 3.2.1)

UPDATE: I posted on the Godot features forum and some said, so it like this:

In settings, under Display/Window:
Width: 1080
Height: 1920
Test Width: 540
Test Height: 960
Mode: Viewport
Aspect: Keep
Shrink: 1

by (1,963 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.