Skip to content

Commit 291d3bc

Browse files
authored
Added an overview of the containers subtypes (godotengine#7722)
* Added an overview of the containers subtypes * converted all images to .webp format
1 parent 19d82e1 commit 291d3bc

File tree

7 files changed

+40
-0
lines changed

7 files changed

+40
-0
lines changed

tutorials/ui/gui_containers.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,46 @@ Mouse wheel and touch drag (when touch is available) are also valid ways to pan
159159

160160
As in the example above, one of the most common ways to use this container is together with a *VBoxContainer* as child.
161161

162+
AspectRatioContainer
163+
^^^^^^^^^^^^^^^^^^^^
164+
165+
A container type that arranges its child controls in a way that preserves their proportions
166+
automatically when the container is resized.
167+
(via :ref:`AspectRatioContainer <class_AspectRatioContainer>`).
168+
It has multiple stretch modes, providing options for adjusting the child controls' sizes concerning the container:
169+
"fill," "width control height," "height control width," and "cover."
170+
171+
.. image:: img/containers_aspectratio.webp
172+
173+
useful when you have a container that needs to be dynamic and responsive to different screen sizes,
174+
and you want the child elements to scale proportionally without losing their intended shapes.
175+
176+
.. image:: img/containers_aspectratio_drag.webp
177+
178+
FlowContainer
179+
^^^^^^^^^^^^^^
180+
181+
FlowContainer is a container that arranges its child controls either horizontally or vertically,
182+
(via :ref:`HFlowContainer <class_HFlowContainer>` and via :ref:`VFlowContainer <class_VFlowContainer>`).
183+
and when the available space runs out, it wraps the children to the next line or column, similar to how text wraps in a book.
184+
185+
186+
.. image:: img/containers_hflow.webp
187+
188+
useful for creating flexible layouts where the child controls adjust automatically to the available space without overlapping.
189+
190+
.. image:: img/containers_hflow_drag.webp
191+
192+
CenterContainer
193+
^^^^^^^^^^^^^^^^^^^^
194+
195+
CenterContainer is a container that automatically keeps all of its child controls centered within it at their minimum size.
196+
It ensures that the child controls are always aligned to the center, making it easier to create centered layouts without manual positioning.
197+
(via :ref:`CenterContainer <class_CenterContainer>`).
198+
199+
.. image:: img/containers_center.webp
200+
201+
.. image:: img/containers_center_drag.webp
162202

163203
SubViewportContainer
164204
^^^^^^^^^^^^^^^^^^^^
2.52 KB
Loading
94.8 KB
Loading
2.42 KB
Loading
85.6 KB
Loading
4.81 KB
Loading
80.7 KB
Loading

0 commit comments

Comments
 (0)