Detecting available resolutions and resizing ONLY viewport

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DevilBlackDeath
:warning: Old Version Published before Godot 3 was released.

Hello everyone !

So I just went across what could be a major problem to me if there is no solution =/ So my question is : Is there any way to change the fullscreen resolution ?

Let’s say I have a 2D game that runs in fullscreen with a base resolution of 1080p. Is there any way to detect all available resolutions (to display them in a list on an option menu) ?

And as a result, is it possible to change the effective fullscreen resolution instead of going with the highest resolution ? (yes, some computers sometimes have a hard actually displaying the highest resolution even when the viewport is smaller, that’s why games keep giving resolution and rendering resolution options :wink: )

I’ve tried using set_window_size() et get_tree().get_root().set_rect() but both give me the same result, the game gets rendered only on a smaller portion of the screen (corresponding to the difference in resolution), and the rest has a flashing black/godot logo issue…

But even more so, if the engine does not allow for fullscreen resolution change, I would be real sad.

Thanks in advance everyone, have a good day

AFAIK, changing resolution is not supported.
Actually, even some of OS not support it like Android.

volzhs | 2016-09-17 05:22

I think no one cares about changing resolution in Android, but what about Win, Linux, OSX? 90% of Steam games offers possibility of changing resolution to gain performance. If it is not supported it definitively deserve feature request in Github ;).

lukas | 2016-09-18 21:04

Definitely my opinion ! And it’s as easy as requesting the display modes from the graphic API (which in turn allows the game to know the existence of future, still non existent resolution in the future). Sadly they already said their main audience were mobile developers because they were the majority of Godot users, so I guess I’ll keep it for barely more than prototyping =\

DevilBlackDeath | 2016-09-18 21:34