class_boxcontainer.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/BoxContainer.xml.
  6. .. _class_BoxContainer:
  7. BoxContainer
  8. ============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`HBoxContainer<class_HBoxContainer>`, :ref:`VBoxContainer<class_VBoxContainer>`
  11. A container that arranges its child controls horizontally or vertically.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A container that arranges its child controls horizontally or vertically, rearranging them automatically when their minimum size changes.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using Containers <../tutorials/ui/gui_containers>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  26. | :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` | :ref:`alignment<class_BoxContainer_property_alignment>` | ``0`` |
  27. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  28. | :ref:`bool<class_bool>` | :ref:`vertical<class_BoxContainer_property_vertical>` | ``false`` |
  29. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  30. .. rst-class:: classref-reftable-group
  31. Methods
  32. -------
  33. .. table::
  34. :widths: auto
  35. +-------------------------------+------------------------------------------------------------------------------------------------+
  36. | :ref:`Control<class_Control>` | :ref:`add_spacer<class_BoxContainer_method_add_spacer>`\ (\ begin\: :ref:`bool<class_bool>`\ ) |
  37. +-------------------------------+------------------------------------------------------------------------------------------------+
  38. .. rst-class:: classref-reftable-group
  39. Theme Properties
  40. ----------------
  41. .. table::
  42. :widths: auto
  43. +-----------------------+-----------------------------------------------------------------+-------+
  44. | :ref:`int<class_int>` | :ref:`separation<class_BoxContainer_theme_constant_separation>` | ``4`` |
  45. +-----------------------+-----------------------------------------------------------------+-------+
  46. .. rst-class:: classref-section-separator
  47. ----
  48. .. rst-class:: classref-descriptions-group
  49. Enumerations
  50. ------------
  51. .. _enum_BoxContainer_AlignmentMode:
  52. .. rst-class:: classref-enumeration
  53. enum **AlignmentMode**: :ref:`🔗<enum_BoxContainer_AlignmentMode>`
  54. .. _class_BoxContainer_constant_ALIGNMENT_BEGIN:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
  57. 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).
  58. .. _class_BoxContainer_constant_ALIGNMENT_CENTER:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
  61. The child controls will be centered in the container.
  62. .. _class_BoxContainer_constant_ALIGNMENT_END:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_END** = ``2``
  65. 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).
  66. .. rst-class:: classref-section-separator
  67. ----
  68. .. rst-class:: classref-descriptions-group
  69. Property Descriptions
  70. ---------------------
  71. .. _class_BoxContainer_property_alignment:
  72. .. rst-class:: classref-property
  73. :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **alignment** = ``0`` :ref:`🔗<class_BoxContainer_property_alignment>`
  74. .. rst-class:: classref-property-setget
  75. - |void| **set_alignment**\ (\ value\: :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>`\ )
  76. - :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **get_alignment**\ (\ )
  77. The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN<class_BoxContainer_constant_ALIGNMENT_BEGIN>`, :ref:`ALIGNMENT_CENTER<class_BoxContainer_constant_ALIGNMENT_CENTER>`, or :ref:`ALIGNMENT_END<class_BoxContainer_constant_ALIGNMENT_END>`).
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_BoxContainer_property_vertical:
  81. .. rst-class:: classref-property
  82. :ref:`bool<class_bool>` **vertical** = ``false`` :ref:`🔗<class_BoxContainer_property_vertical>`
  83. .. rst-class:: classref-property-setget
  84. - |void| **set_vertical**\ (\ value\: :ref:`bool<class_bool>`\ )
  85. - :ref:`bool<class_bool>` **is_vertical**\ (\ )
  86. If ``true``, the **BoxContainer** will arrange its children vertically, rather than horizontally.
  87. Can't be changed when using :ref:`HBoxContainer<class_HBoxContainer>` and :ref:`VBoxContainer<class_VBoxContainer>`.
  88. .. rst-class:: classref-section-separator
  89. ----
  90. .. rst-class:: classref-descriptions-group
  91. Method Descriptions
  92. -------------------
  93. .. _class_BoxContainer_method_add_spacer:
  94. .. rst-class:: classref-method
  95. :ref:`Control<class_Control>` **add_spacer**\ (\ begin\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_BoxContainer_method_add_spacer>`
  96. Adds a :ref:`Control<class_Control>` node to the box as a spacer. If ``begin`` is ``true``, it will insert the :ref:`Control<class_Control>` node in front of all other children.
  97. .. rst-class:: classref-section-separator
  98. ----
  99. .. rst-class:: classref-descriptions-group
  100. Theme Property Descriptions
  101. ---------------------------
  102. .. _class_BoxContainer_theme_constant_separation:
  103. .. rst-class:: classref-themeproperty
  104. :ref:`int<class_int>` **separation** = ``4`` :ref:`🔗<class_BoxContainer_theme_constant_separation>`
  105. The space between the **BoxContainer**'s elements, in pixels.
  106. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  107. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  108. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  109. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  110. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  111. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  112. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  113. .. |void| replace:: :abbr:`void (No return value.)`