Godot Version
4.1.1 mono
Question
Is there a way to get a list of supported computer resolutions? Previously, I could get an array of supported resolutions in Unreal Engine. I don’t want to enter them manually.
4.1.1 mono
Is there a way to get a list of supported computer resolutions? Previously, I could get an array of supported resolutions in Unreal Engine. I don’t want to enter them manually.
It’s not the 90s. You can get the current screen resolution and render at any multiple of that pixel size, then scale up if you need. There is no use case I can think of that could run a godot application and need a resolution setting that’s a list of supported resolutions. Think about aspect ratios instead, and wether it matters for your purposes.
Not sure it’s possible. I’d have a look at Multiple Resolutions for info on it.
This is indeed not supported by design, quoting the documentation:
Godot follows a modern approach to multiple resolutions. The engine will never change the monitor’s resolution on its own. While changing the monitor’s resolution is the most efficient approach, it’s also the least reliable approach as it can leave the monitor stuck on a low resolution if the game crashes. This is especially common on macOS or Linux which don’t handle resolution changes as well as Windows.
Changing the monitor’s resolution also removes any control from the game developer over filtering and aspect ratio stretching, which can be important to ensure correct display for pixel art games.
On top of that, changing the monitor’s resolution makes alt-tabbing in and out of a game much slower since the monitor has to change resolutions every time this is done.
If you really want to expose a set of premade resolutions for the user to choose from, define an array of Vector2i and display choices in an OptionButton that are lower than or equal to the current screen’s width and height. Still in most cases, exposing a 3D resolution scale factor (for performance) or 2D scale factor (for usability) is preferable.
Check the Multiple Resolutions demo project for additional guidance
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.