In Project Settings → View → Window we have a stretch scale. I want to change the same parameter in a script. How can I?
What I do changes the value, but it doesn’t change anything in the scene :
func scale_to_resolution(resolution):
ProjectSettings.set_setting(“display/window/stretch/scale”, resolution)
print(str(ProjectSettings.get_setting(“display/window/stretch/scale”)))
I believe you’re setting the property correctly. However, it looks like this property is only used once on startup and doesn’t update on real-time changed in-game.
Despite being an old thread, I was just looking for something similar, and this answer put me on the right track. Posting here in case it helps someone else.
Although changing the setting has no effect once the application has started, you can manually change the scale factor using the Window API.
In yet another follow up, it seems it has been changed to allow for real-time updating. Attached to a slider and am able to adjust the scale on the fly.