Files
godot-docs/classes/class_container.rst
2022-02-01 16:35:13 +01:00

92 lines
4.3 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the Container.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_Container:
Container
=========
**Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AspectRatioContainer<class_AspectRatioContainer>`, :ref:`BoxContainer<class_BoxContainer>`, :ref:`CenterContainer<class_CenterContainer>`, :ref:`EditorProperty<class_EditorProperty>`, :ref:`FlowContainer<class_FlowContainer>`, :ref:`GraphNode<class_GraphNode>`, :ref:`GridContainer<class_GridContainer>`, :ref:`MarginContainer<class_MarginContainer>`, :ref:`PanelContainer<class_PanelContainer>`, :ref:`ScrollContainer<class_ScrollContainer>`, :ref:`SplitContainer<class_SplitContainer>`, :ref:`SubViewportContainer<class_SubViewportContainer>`, :ref:`TabContainer<class_TabContainer>`
Base node for containers.
Description
-----------
Base node for containers. A ``Container`` contains other controls and automatically arranges them in a certain way.
A Control can inherit this to create custom container classes.
Properties
----------
+----------------------------------------------+--------------+-----------------------------------------------------------------------+
| :ref:`MouseFilter<enum_Control_MouseFilter>` | mouse_filter | ``1`` (overrides :ref:`Control<class_Control_property_mouse_filter>`) |
+----------------------------------------------+--------------+-----------------------------------------------------------------------+
Methods
-------
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`fit_child_in_rect<class_Container_method_fit_child_in_rect>` **(** :ref:`Control<class_Control>` child, :ref:`Rect2<class_Rect2>` rect **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue_sort<class_Container_method_queue_sort>` **(** **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_Container_signal_pre_sort_children:
- **pre_sort_children** **(** **)**
Emitted when children are going to be sorted.
----
.. _class_Container_signal_sort_children:
- **sort_children** **(** **)**
Emitted when sorting the children is needed.
Constants
---------
.. _class_Container_constant_NOTIFICATION_PRE_SORT_CHILDREN:
.. _class_Container_constant_NOTIFICATION_SORT_CHILDREN:
- **NOTIFICATION_PRE_SORT_CHILDREN** = **50** --- Notification just before children are going to be sorted, in case there's something to process beforehand.
- **NOTIFICATION_SORT_CHILDREN** = **51** --- Notification for when sorting the children, it must be obeyed immediately.
Method Descriptions
-------------------
.. _class_Container_method_fit_child_in_rect:
- void **fit_child_in_rect** **(** :ref:`Control<class_Control>` child, :ref:`Rect2<class_Rect2>` rect **)**
Fit a child control in a given rect. This is mainly a helper for creating custom container classes.
----
.. _class_Container_method_queue_sort:
- void **queue_sort** **(** **)**
Queue resort of the contained children. This is called automatically anyway, but can be called upon request.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`