Add a simple way to keep aspect ratio of children of a GridContainer #7198
milana-94888u
started this conversation in
GUI
Replies: 2 comments 1 reply
-
@milana-94888u did you ever find a solution or workaround to achieve this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
You want this right? A stacking uniform grid? It is possible using base controls (without code) but unfortunately it is a very inelegant solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many games have something like level selection menu with multiple buttons in grid. They usually square. But in godot there's no way to compose Control nodes so they can do this. The problem with adding a AspectRatioContainer as a child node of a GridContainer is that AspectRatioContainer doesn't change own size but resize its children. So if I want to expand children of GridContainer to fill its width and I want to keep them square there's no simple way to properly align them vertically because of child nodes of AspectRatioContainer become bigger than a AspectRatioContainer itself and start cover each other added to a GridContainer. So that I want to propose to add something like AspectRatioGridContainer that will allow to keep the aspect of its children fixed and set their vertical sizing automatically
Beta Was this translation helpful? Give feedback.
All reactions