0 votes

How can I change to fullscreen on the fly?
I used the code below but the game was only in fullscreen after restarting the game

ProjectSettings.set(“display/window/size/fullscreen”, true)
ProjectSettings.save()

What I thought that could be a sollution was to set the window height and width to the player’s display height and width. I thought that I could het the player’s display size using OS but I figured out that I can only get the game window size, so it has no use on this situation.

So, is tuere a way to change to fullscreen without needing to restart the game?

asked Jan 13, 2019 in Engine by fpicoral (498 points)

1 Answer

0 votes

try to set OS.window_fullscreen to true from code
also if you want to make it so that you can turn it off again you could use:

OS.window_fullscreen = !OS.window_fullscreen

try to use this code on a button

answered Jan 13, 2019 by Tova (154 points)
edited Jan 13, 2019 by Calinou
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.