0 votes

Okay, so you know how in project settings you have display -> window -> size? I want to change that value and have it affect the game during runtime. The docs say that I can't do this since those values are determined at start up. How can I change that value at start up then?

Godot version 3.4
in Engine by (8,150 points)

1 Answer

+1 vote

Well you can use


to set the window size but I dont know what would happen if you tried to set it too a larger size than the current OS setup. You could use something like the below.

func _ready():
    When something is true:
         Resize_Screen(640, 480)

func Resize_Screen(First, Second):
    OS.set_window_size(Vector2(First, Second))

Which would allow you to set the window size to anything you passed as arguments.

by (3,009 points)

I don't want to change the window size. I want to change the resolution of the game.

Check the TPS demo, the options part. It's done with viewports. I dont remember more details by mind

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 Frequently asked questions and 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 [email protected] with your username.