#Set full screen via game options so exported game would start in such mode

11 messages · Page 1 of 1 (latest)

modest dune
#

In the Godot editor, configuring the Windows display mode as either Full Screen or Windowed is straightforward through project settings. After exporting, the game will launch in the chosen mode. However, if you wish to dynamically change how the game starts via settings, you must first load your settings and then set them programmatically, like this: DisplayServer.window_set_mode(screenMode);

For instance, if your game initially starts in Full Screen mode, but the settings indicate Windowed mode, what may occur is the game expanding to full screen initially and then contracting to a windowed state after the settings are loaded. To circumvent this behavior, is there a method to instruct Godot to initiate the game in a specific window mode applicable to the exported game and modifiable via settings?

crimson pike
#

why not make fullscreen the default for the window_set_mode and make if statements to change it?
or maybe im misinterpreting the issue

modest dune
#

I can try to elaborate. The problem is: if game was exported in full screen and you setting it to windowed after loading some option settings the game screen will expand then contract and vice versa. What I am looking is smooth experience where I start game window in the mode I set via options.

crimson pike
#

ahh so basically it doesnt save the settings you set after you close and open again?

modest dune
#

Settings are saved and loaded just fine. DisplayServer.window_set_mode(screenMode); also works just fine. But game itself start only in mode I exported it in. So if I exported in full screen and after launching the game It start in full screen and then suddenly contracts to windowed when I set DisplayServer.window_set_mode(WindowMode.Windowed);. What I am looking for is a way to start the game in different windows mode after it was exported, not set the mode after game window is already created.

crimson pike
#

under what function did you write the window_set_mode?

#

writing it under _ready is the only thing else i can think of at this point, sorry

modest dune
#

I load settings even earlier than _ready on _enter_tree, however window is already created at that point so there should be another way. Something akin to changing project setting but to already exported game

modest dune
#

Here is actual solution:
-Set "Project Settings Override" to user://custom_overrides.cfg
-When player changes window mode in the game, save it to user://custom_overrides.cfg like this (0 = window, 3 = fullscreen):
[display]
window/size/mode=3

torn heath
left tartan
#

I had a similar but related question to this. I don't like that you have to hard code based on an index of a drop down menu. I was hoping it could make use of the constants they provide like DisplayServer.WINDOW_MODE_FULLSCREEN