Skip to content

Commit e4b27c1

Browse files
Merge pull request #10934 from ProgrammerOnCoffee/update-gui-containers
Update the Using Containers tutorial
1 parent 813168b commit e4b27c1

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

tutorials/ui/gui_containers.rst

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
:article_outdated: True
2-
31
.. _doc_gui_containers:
42

53
Using Containers
@@ -141,12 +139,19 @@ It respects both the horizontal and vertical sizing options.
141139

142140
.. image:: img/containers_panel.png
143141

144-
This container is useful as top-level, or just to add custom backgrounds to sections of a layout.
142+
This container is useful as a top-level control, or just to add custom backgrounds to sections of a layout.
143+
144+
FoldableContainer
145+
~~~~~~~~~~~~~~~~~
146+
147+
A container that can be expanded/collapsed
148+
(via :ref:`FoldableContainer <class_FoldableContainer>`).
149+
Child controls are hidden when it is collapsed.
145150

146151
ScrollContainer
147152
~~~~~~~~~~~~~~~
148153

149-
Accepts a single child node. If this node is bigger than the container, scrollbars will be added
154+
Accepts a single child node. If the child node is bigger than the container, scrollbars will be added
150155
to allow panning the node around (via :ref:`ScrollContainer <class_ScrollContainer>`). Both
151156
vertical and horizontal size options are respected, and the behavior can be turned on or off
152157
per axis in the properties.
@@ -170,30 +175,30 @@ It has multiple stretch modes, providing options for adjusting the child control
170175

171176
.. image:: img/containers_aspectratio.webp
172177

173-
useful when you have a container that needs to be dynamic and responsive to different screen sizes,
178+
It is useful when you have a container that needs to be dynamic and responsive to different screen sizes,
174179
and you want the child elements to scale proportionally without losing their intended shapes.
175180

176181
.. image:: img/containers_aspectratio_drag.webp
177182

178183
FlowContainer
179184
~~~~~~~~~~~~~
180185

181-
FlowContainer is a container that arranges its child controls either horizontally or vertically,
186+
FlowContainer is a container that arranges its child controls either horizontally or vertically
182187
(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.
188+
When the available space runs out, it wraps the children to the next line or column, similar to how text wraps in a book.
184189

185190

186191
.. image:: img/containers_hflow.webp
187192

188-
useful for creating flexible layouts where the child controls adjust automatically to the available space without overlapping.
193+
It is useful for creating flexible layouts where the child controls adjust automatically to the available space without overlapping.
189194

190195
.. image:: img/containers_hflow_drag.webp
191196

192197
CenterContainer
193198
~~~~~~~~~~~~~~~
194199

195200
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.
201+
It ensures that the child controls are always aligned to the center, making it easier to create centered layouts without manual positioning
197202
(via :ref:`CenterContainer <class_CenterContainer>`).
198203

199204
.. image:: img/containers_center.webp
@@ -210,7 +215,7 @@ Creating custom Containers
210215
--------------------------
211216

212217
It is possible to create a custom container using a script.
213-
Here is an example of a container that fits children to its rect size:
218+
Here is an example of a container that fits children to its size:
214219

215220
.. tabs::
216221
.. code-tab:: gdscript GDScript
@@ -222,7 +227,7 @@ Here is an example of a container that fits children to its rect size:
222227
# Must re-sort the children
223228
for c in get_children():
224229
# Fit to own size
225-
fit_child_in_rect(c, Rect2(Vector2(), rect_size))
230+
fit_child_in_rect(c, Rect2(Vector2(), size))
226231

227232
func set_some_setting():
228233
# Some setting changed, ask for children re-sort.
@@ -242,7 +247,7 @@ Here is an example of a container that fits children to its rect size:
242247
foreach (Control c in GetChildren())
243248
{
244249
// Fit to own size
245-
FitChildInRect(c, new Rect2(new Vector2(), RectSize));
250+
FitChildInRect(c, new Rect2(new Vector2(), Size));
246251
}
247252
}
248253
}

0 commit comments

Comments
 (0)