Best way to support multiple resolutions?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Liemaeu

What is the best way to support different resolutions? (PC game, not mobile)

How I do it at the moment:
I go to the Project Settings → Display → Window → Size
and set Width and Height to the maximum resolution I want to support (3840 x 2160 currently). So I can set up the menus, etc. correctly for higher resolutions, too. I set the Test Width and Test Height to the resolution of my monitor I am developing on (1920 x 1080 currently) and add graphics settings that use the OS.set_window_size() function to the final game to set up the resolution.

So far this works, but what about 21:9, 32:9, 16:10, etc. screens?

How can I set the menus up for them?

Is there any “good” way of adding bigger background textures, that cover all screen resolutions?

A simplified example: I use a 16:10 image as background image for the main menu, but on a 16:9 screen only a part of the image is visible.

How can I set this up properly?

1 Like
:bust_in_silhouette: Reply From: Calinou

So far this works, but what about 21:9, 32:9, 16:10, etc. screens?

To support multiple aspect ratios, use the expand stretch aspect and configure UI anchors correctly in your Control-derived nodes. See Multiple resolutions in the documentation for more information.

Is there any “good” way of adding bigger background textures, that cover all screen resolutions?

A simplified example: I use a 16:10 image as background image for the main menu, but on a 16:9 screen only a part of the image is visible.

There is no “perfect” way to handle this. Ideally, you should provide an image that’s as wide as the widest aspect ratio you aim to support, but this isn’t always realistically feasible for various reasons.

You can use a TextureRect node with the Layout mode set to Center to display an image with the widest aspect ratio. Only the center portion of the image will be visible on narrower aspect ratios.

Thank you very much!
Great idea handling the background texture with a TextureRect.

Liemaeu | 2021-02-22 08:12