Skip to content
Search

Godot:SizeAndAnchors

lastmod 2022-03-18created 2022-03-181 edits

If a game was always going to run on the same device and at the same resolution, positioning controls would be a simple matter of setting the position and size of each one. Unfortunately, that is rarely the case.

Only TVs nowadays have a standard resolution and aspect ratio. Everything else, from computer monitors to tablets, portable consoles and mobile phones, has a different resolution and aspect ratio.

There are several ways to handle this, but for now, let's just imagine that the screen resolution has changed and the controls need to be re-positioned. Some will need to follow the bottom of the screen, others the top of the screen, or maybe the right or left margins.

Godot_-size_and_anchors-_anchors.png

See also

Favorite site

author Zer0 sitemap