0 votes

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?

Godot version 3.2.3
in Engine by (130 points)

1 Answer

+1 vote
Best answer

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.

by (9,370 points)
selected by

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.