I'd like to be able to change the default resolution of my game's viewport during runtime, to allow the player to toggle between "widescreen" and "4x3" modes.
I've already worked out how to change the window size in GScript, but that's not creating the result I'm looking for. The viewport is retaining its base resolution, and thus, its aspect ratio. Which, yes, I understand, is how the engine is designed to be used. But I'd rather be able to toggle between those two base resolutions so the game knows where to arrange things on the screen, than to rely on scaling and leave the game with no idea whether or not it's in widescreen mode.
Given how easy it is to set that "base" resolution in the project settings, I find it hard to believe there's no way to change it in code. I've been trawling the docs and Google searches, and hitting my head against my project, for hours now, and can't find an answer anywhere.
Does anyone know the command to change the viewport resolution in GDScript? Is it even possible?