mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
Added an overview of the containers subtypes (#7722)
* Added an overview of the containers subtypes * converted all images to .webp format
This commit is contained in:
@@ -159,6 +159,46 @@ Mouse wheel and touch drag (when touch is available) are also valid ways to pan
|
||||
|
||||
As in the example above, one of the most common ways to use this container is together with a *VBoxContainer* as child.
|
||||
|
||||
AspectRatioContainer
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A container type that arranges its child controls in a way that preserves their proportions
|
||||
automatically when the container is resized.
|
||||
(via :ref:`AspectRatioContainer <class_AspectRatioContainer>`).
|
||||
It has multiple stretch modes, providing options for adjusting the child controls' sizes concerning the container:
|
||||
"fill," "width control height," "height control width," and "cover."
|
||||
|
||||
.. image:: img/containers_aspectratio.webp
|
||||
|
||||
useful when you have a container that needs to be dynamic and responsive to different screen sizes,
|
||||
and you want the child elements to scale proportionally without losing their intended shapes.
|
||||
|
||||
.. image:: img/containers_aspectratio_drag.webp
|
||||
|
||||
FlowContainer
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
FlowContainer is a container that arranges its child controls either horizontally or vertically,
|
||||
(via :ref:`HFlowContainer <class_HFlowContainer>` and via :ref:`VFlowContainer <class_VFlowContainer>`).
|
||||
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.
|
||||
|
||||
|
||||
.. image:: img/containers_hflow.webp
|
||||
|
||||
useful for creating flexible layouts where the child controls adjust automatically to the available space without overlapping.
|
||||
|
||||
.. image:: img/containers_hflow_drag.webp
|
||||
|
||||
CenterContainer
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
CenterContainer is a container that automatically keeps all of its child controls centered within it at their minimum size.
|
||||
It ensures that the child controls are always aligned to the center, making it easier to create centered layouts without manual positioning.
|
||||
(via :ref:`CenterContainer <class_CenterContainer>`).
|
||||
|
||||
.. image:: img/containers_center.webp
|
||||
|
||||
.. image:: img/containers_center_drag.webp
|
||||
|
||||
SubViewportContainer
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
BIN
tutorials/ui/img/containers_aspectratio.webp
Normal file
BIN
tutorials/ui/img/containers_aspectratio.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
tutorials/ui/img/containers_aspectratio_drag.webp
Normal file
BIN
tutorials/ui/img/containers_aspectratio_drag.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
BIN
tutorials/ui/img/containers_center.webp
Normal file
BIN
tutorials/ui/img/containers_center.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
tutorials/ui/img/containers_center_drag.webp
Normal file
BIN
tutorials/ui/img/containers_center_drag.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
BIN
tutorials/ui/img/containers_hflow.webp
Normal file
BIN
tutorials/ui/img/containers_hflow.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
tutorials/ui/img/containers_hflow_drag.webp
Normal file
BIN
tutorials/ui/img/containers_hflow_drag.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Reference in New Issue
Block a user