Use the canvas_items
(formerly 2d
) stretch mode by default in new projects (instead of disabled
)
#3939
Labels
Milestone
Related to #2701.
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
With hiDPI support now being enabled by default, supporting multiple resolutions in exported projects is more important than ever.
However, Godot currently uses the
disabled
stretch mode by default. This is a good approach for applications which should not scale automatically as the window is resized, but it falls short for games as UI elements can quickly become too small. This can harm the gameplay experience (and accessibility) as important information should always be displayed at a readable size.Scaling 2D elements according to resolution is an approach that works well to support hiDPI displays, since it will result in larger 2D elements at higher resolutions. This is also useful for 3D games to ensure HUD elements always remain readable.
It should also be kept in mind that display resolutions are something that continuously evolves over time. 4K monitors are becoming more and more common, and 5K/6K/8K will likely follow the same steps in a few years' time. It's usually not possible for a developer to account for all those resolutions in advance.
If you've played an old game on a modern display at native resolution, you probably know that the stretch mode chosen by the developer makes all the difference between a playable game at high resolutions and a borderline unplayable experience.1
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Use the
canvas_items
stretch mode by default. This is the stretch mode that works best for non-pixel art games in general (and even many pixel art games, provided texture filtering is disabled).Since most people are using Godot to develop games (rather than applications), it makes sense to use a stretch mode that works best for games by default. Another upside of the
canvas_items
stretch mode is that it levels the playing field in 2D competitive games, as people are more likely to get the same screen real estate regardless of their screen resolution.Note that I would recommend changing the default window size to be 16:9 as well: godotengine/godot#55032
Otherwise, there will be black bars when playing in fullscreen on a 16:9 monitors in a project that uses the current default resolution (1024×600, which is not 16:9).
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Replace
"disabled"
with"canvas_items"
here: https://github.com/godotengine/godot/blob/f91e5bad8ce2ae30834e0f46be644dbc1d9daf10/main/main.cpp#L2347This change would only be applied to Godot 4.0, not Godot 3.x.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, as this is about changing a default engine setting.
Is there a reason why this should be core and not an add-on in the asset library?
This is about changing a default engine setting to improve the experience of developers and players alike.
Footnotes
And this is "only" 1440p, not even 4K 🙂 ↩
The text was updated successfully, but these errors were encountered: