:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/BoxContainer.xml. .. _class_BoxContainer: BoxContainer ============ **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`ColorPicker`, :ref:`HBoxContainer`, :ref:`VBoxContainer` Base class for box containers. Description ----------- Arranges child :ref:`Control` nodes vertically or horizontally, and rearranges them automatically when their minimum size changes. Tutorials --------- - :doc:`GUI containers <../tutorials/ui/gui_containers>` Properties ---------- +-------------------------------------------------------+---------------------------------------------------------+-----------+ | :ref:`AlignmentMode` | :ref:`alignment` | ``0`` | +-------------------------------------------------------+---------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`vertical` | ``false`` | +-------------------------------------------------------+---------------------------------------------------------+-----------+ Methods ------- +-------------------------------+---------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`add_spacer` **(** :ref:`bool` begin **)** | +-------------------------------+---------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +-----------------------+-----------------------------------------------------------------+-------+ | :ref:`int` | :ref:`separation` | ``4`` | +-----------------------+-----------------------------------------------------------------+-------+ Enumerations ------------ .. _enum_BoxContainer_AlignmentMode: .. _class_BoxContainer_constant_ALIGNMENT_BEGIN: .. _class_BoxContainer_constant_ALIGNMENT_CENTER: .. _class_BoxContainer_constant_ALIGNMENT_END: enum **AlignmentMode**: - **ALIGNMENT_BEGIN** = **0** --- The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). - **ALIGNMENT_CENTER** = **1** --- The child controls will be centered in the container. - **ALIGNMENT_END** = **2** --- The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). Property Descriptions --------------------- .. _class_BoxContainer_property_alignment: - :ref:`AlignmentMode` **alignment** +-----------+----------------------+ | *Default* | ``0`` | +-----------+----------------------+ | *Setter* | set_alignment(value) | +-----------+----------------------+ | *Getter* | get_alignment() | +-----------+----------------------+ The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN`, :ref:`ALIGNMENT_CENTER`, or :ref:`ALIGNMENT_END`). ---- .. _class_BoxContainer_property_vertical: - :ref:`bool` **vertical** +-----------+---------------------+ | *Default* | ``false`` | +-----------+---------------------+ | *Setter* | set_vertical(value) | +-----------+---------------------+ | *Getter* | is_vertical() | +-----------+---------------------+ If ``true``, the ``BoxContainer`` will arrange its children vertically, rather than horizontally. Can't be changed when using :ref:`HBoxContainer` and :ref:`VBoxContainer`. Method Descriptions ------------------- .. _class_BoxContainer_method_add_spacer: - :ref:`Control` **add_spacer** **(** :ref:`bool` begin **)** Adds a :ref:`Control` node to the box as a spacer. If ``begin`` is ``true``, it will insert the :ref:`Control` node in front of all other children. Theme Property Descriptions --------------------------- .. _class_BoxContainer_theme_constant_separation: - :ref:`int` **separation** +-----------+-------+ | *Default* | ``4`` | +-----------+-------+ The space between the ``BoxContainer``'s elements, in pixels. .. |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.)`