Topic was automatically imported from the old Question2Answer platform.
Asked By
jeff
Old Version
Published before Godot 3 was released.
Right now I’m creating the Settings panel for my game, and I figured that the cleanest way to go about this is to persist the changes to the actual project settings themselves.
For example, for the resolution setting, after the user picks the resolution I run the following:
OS.set_window_size(resolution) #it appears setting the property doesn't actually change the resolution, so I have to call this as well
Globals.set("display/height", resolution.y)
Globals.set("display/width", resolution.x)
After calling the set function, the property does change to the new value. However, after exiting the game, the property is reverted back to the original value. Am I simply not supposed to adjust the Project Settings dynamically, or is there something I’m missing?
If that doesn’t work you probably have to read and parse the engine.cfg file, and change the appropriate setting under the [Category].
Thank you, this is the correct answer for editing the project settings. Not sure why I couldn’t find the save() call in previous answers. Additionally, for my purposes, I forgot that the width and height specified is separate from the resized resolution. Test_width and test_height seem to serve that purpose instead.