Use the keep
stretch aspect by default (instead of ignore
)
#2701
Labels
Milestone
keep
stretch aspect by default (instead of ignore
)
#2701
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Some developers have trouble supporting multiple resolutions and aspect ratios, despite the documentation on the subject being fairly thorough.
Here's an example of this happening in the wild: https://www.gamingonlinux.com/2021/05/free-game-thursday-check-out-office-point-rescue-deja-vu-a-new-retro-fps/comment_id=202920
Unfortunately, it's quite common for Godot games not to support multiple aspect ratios, despite Godot's support being quite good for it. With the right UI node anchor configuration, 48:9 surround setups can even be supported!
Describe the feature / enhancement and how it helps to overcome the problem or limitation
By changing the default value from
ignore
toexpand
, developers have one less setting to change to get multiple resolution and aspect ratio support working.The developer will still have to choose a stretch mode since
expand
does nothing if the stretch mode isdisabled
. Nonetheless, I considerexpand
to be a "better" default that suits more use cases. (Screen distortion is almost never desired.)We might also consider also changing the default stretch mode to
canvas_items
(called2d
in3.x
), but that might be a bit much as it requires UI anchors to be defined to work as expected. You would also pretty much always need to have a Camera2D in your scene for 2D games, even if the camera never moves. This would likely complicate tutorials a bit.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Change the default setting of the stretch aspect project setting fromignore
toexpand
.Why notkeep
?keep
adds black bars at the screen edges. While it is better than distorting the image, it is worse than providing proper support for multiple aspect ratios. Ultrawide monitors are not that rare among gamers nowadays, and some people also play games on 16:10 or 3:2 laptops occasionally. Don't assume everyone is using 16:9 🙂Edit: In the end, we decided to go for
keep
as some games aren't designed to work well with multiple aspect ratios.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 setting value and improving the out of the box developer experience.
Is there a reason why this should be core and not an add-on in the asset library?
See above.
The text was updated successfully, but these errors were encountered: