Edit of asset "Multiple Resolutions and Aspect Ratios Demo" Accepted
Old/Current | New/Edit | |
---|---|---|
Title | Multiple Resolutions and Aspect Ratios Demo | Multiple Resolutions and Aspect Ratios Demo |
Description |
This project demonstrates how to set up a project to handle screens of multiple resolutions and aspect ratios. This demo allows you to adjust the window's base resolution, stretch mode, stretch aspect, and scale factor (internally known as "stretch shrink"). This lets you see what happens when adjusting those properties. Make sure to resize the project window in any direction to see the difference with the various stretch mode and stretch aspect settings. The GUI can be made to fit the window or constrained to a specific aspect ratio from a list of common aspect ratios. On ultrawide aspect ratios, this can be used to prevent HUD elements from being too spread apart, which can harm the gameplay experience. For non-essential HUD elements, specific controls can be made to ignore this aspect ratio constraint when it makes sense (e.g. a list of players on the side of the screen). Additionally, a GUI margin setting is provided to better handle TVs with an overscan area to prevent GUI elements from being cut off. This can also improve the gameplay experience on large monitors by bringing HUD elements closer to the center of the screen. A DynamicFont with multichannel signed distance field (MSDF) rendering is also used. This allows for crisp font rendering at any resolution, without having to re-rasterize the font when the font size changes. This makes changing the various settings in this demo faster, especially when large font sizes are used as a result of the GUI scale factor setting being increased. Note that by default, Godot uses font oversampling for traditional rasterized DynamicFonts. This means MSDF fonts are *not* required to have crisp fonts at higher-than-default screen resolutions. Language: GDScript Renderer: Compatibility |
This project demonstrates how to set up a project to handle screens of multiple resolutions and aspect ratios. This demo allows you to adjust the window's base resolution, stretch mode, stretch aspect, and scale factor (internally known as "stretch shrink"). This lets you see what happens when adjusting those properties. Make sure to resize the project window in any direction to see the difference with the various stretch mode and stretch aspect settings. The GUI can be made to fit the window or constrained to a specific aspect ratio from a list of common aspect ratios. On ultrawide aspect ratios, this can be used to prevent HUD elements from being too spread apart, which can harm the gameplay experience. For non-essential HUD elements, specific controls can be made to ignore this aspect ratio constraint when it makes sense (e.g. a list of players on the side of the screen). Additionally, a GUI margin setting is provided to better handle TVs with an overscan area to prevent GUI elements from being cut off. This can also improve the gameplay experience on large monitors by bringing HUD elements closer to the center of the screen. A DynamicFont with multichannel signed distance field (MSDF) rendering is also used. This allows for crisp font rendering at any resolution, without having to re-rasterize the font when the font size changes. This makes changing the various settings in this demo faster, especially when large font sizes are used as a result of the GUI scale factor setting being increased. Note that by default, Godot uses font oversampling for traditional rasterized DynamicFonts. This means MSDF fonts are *not* required to have crisp fonts at higher-than-default screen resolutions. Language: GDScript Renderer: Compatibility |
Category | Demos | Demos |
License | MIT | MIT |
Repository Provider | Custom | Custom |
Repository Url | https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/gui/multiple_resolutions | https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/gui/multiple_resolutions |
Issues Url | https://github.com/godotengine/godot-demo-projects/issues | https://github.com/godotengine/godot-demo-projects/issues |
Godot version | Godot 4.2 | Godot 4.2 |
Version String | 4.2-31d1c0c | 4.2-31d1c0c |
Download Commit | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/gui_multiple_resolutions.zip | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/gui_multiple_resolutions.zip |
Download Url (Computed) | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/gui_multiple_resolutions.zip | https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/gui_multiple_resolutions.zip |
Icon Url |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/gui/multiple_resolutions/icon.webp
|
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/gui/multiple_resolutions/icon.webp
|
Preview Insert | ||
---|---|---|
Type | image | |
Image/Video URL |
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/gui/multiple_resolutions/screenshots/multiple_resolutions.png
|
|
Thumbnail |
|