Set the resolution automatically

Hi, is there a kind of event that makes sure that the scene has automatically resons the conb scene the size of the device on which it is executed? Can I implement it via an event?

Excuse me. I didn’t understand.

1 Like

It is possible to set the resolution of the scene through an event to precisely that of the device where it is performed in order to obtain a better interface

There is no magic bullet for resolution.

You can either:
Allow your game to always resize its resolution dependent on the monitor (checkbox in project properties), then use the anchor behavior to lock your GUI in place. This will lead to the player seeing more (or less) of the game area than you intend, and your buttons will be much smaller (or bigger) depending on the display resolution. (This was common WAY back in the day, but hasn’t been common for a decade)

or

Do not allow the game to resize the play area, and use the scaling setting in project properties (either width or height). This may lead to bars on top/bottom or left/right depending on your selection, but your game area will always display the same amount of game regardless of the size of the screen, and the aspect ratio of all buttons will stay the same. (This is pretty common for mobile games)

or

Create GUI assets for a predefined set of resolutions, detect the closest resolution, and use those assets. Automatically adjust the zoom of your game layers (but not GUI layers) based off the resolution. This is common in PC games, but you’re going to have to do a lot of manual math and resizing.

The above options are the same across all engines, although some make the 3rd option easier or harder than others.

3 Likes