class_boxcontainer.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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:`ColorPicker<class_ColorPicker>`, :ref:`HBoxContainer<class_HBoxContainer>`, :ref:`VBoxContainer<class_VBoxContainer>`
  11. Base class for box containers.
  12. Description
  13. -----------
  14. Arranges child :ref:`Control<class_Control>` nodes vertically or horizontally, and rearranges them automatically when their minimum size changes.
  15. Tutorials
  16. ---------
  17. - :doc:`GUI containers <../tutorials/ui/gui_containers>`
  18. Properties
  19. ----------
  20. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  21. | :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` | :ref:`alignment<class_BoxContainer_property_alignment>` | ``0`` |
  22. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`vertical<class_BoxContainer_property_vertical>` | ``false`` |
  24. +-------------------------------------------------------+---------------------------------------------------------+-----------+
  25. Methods
  26. -------
  27. +-------------------------------+---------------------------------------------------------------------------------------------------+
  28. | :ref:`Control<class_Control>` | :ref:`add_spacer<class_BoxContainer_method_add_spacer>` **(** :ref:`bool<class_bool>` begin **)** |
  29. +-------------------------------+---------------------------------------------------------------------------------------------------+
  30. Theme Properties
  31. ----------------
  32. +-----------------------+-----------------------------------------------------------------+-------+
  33. | :ref:`int<class_int>` | :ref:`separation<class_BoxContainer_theme_constant_separation>` | ``4`` |
  34. +-----------------------+-----------------------------------------------------------------+-------+
  35. Enumerations
  36. ------------
  37. .. _enum_BoxContainer_AlignmentMode:
  38. .. _class_BoxContainer_constant_ALIGNMENT_BEGIN:
  39. .. _class_BoxContainer_constant_ALIGNMENT_CENTER:
  40. .. _class_BoxContainer_constant_ALIGNMENT_END:
  41. enum **AlignmentMode**:
  42. - **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).
  43. - **ALIGNMENT_CENTER** = **1** --- The child controls will be centered in the container.
  44. - **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).
  45. Property Descriptions
  46. ---------------------
  47. .. _class_BoxContainer_property_alignment:
  48. - :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **alignment**
  49. +-----------+----------------------+
  50. | *Default* | ``0`` |
  51. +-----------+----------------------+
  52. | *Setter* | set_alignment(value) |
  53. +-----------+----------------------+
  54. | *Getter* | get_alignment() |
  55. +-----------+----------------------+
  56. 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>`).
  57. ----
  58. .. _class_BoxContainer_property_vertical:
  59. - :ref:`bool<class_bool>` **vertical**
  60. +-----------+---------------------+
  61. | *Default* | ``false`` |
  62. +-----------+---------------------+
  63. | *Setter* | set_vertical(value) |
  64. +-----------+---------------------+
  65. | *Getter* | is_vertical() |
  66. +-----------+---------------------+
  67. If ``true``, the ``BoxContainer`` will arrange its children vertically, rather than horizontally.
  68. Can't be changed when using :ref:`HBoxContainer<class_HBoxContainer>` and :ref:`VBoxContainer<class_VBoxContainer>`.
  69. Method Descriptions
  70. -------------------
  71. .. _class_BoxContainer_method_add_spacer:
  72. - :ref:`Control<class_Control>` **add_spacer** **(** :ref:`bool<class_bool>` begin **)**
  73. 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.
  74. Theme Property Descriptions
  75. ---------------------------
  76. .. _class_BoxContainer_theme_constant_separation:
  77. - :ref:`int<class_int>` **separation**
  78. +-----------+-------+
  79. | *Default* | ``4`` |
  80. +-----------+-------+
  81. The space between the ``BoxContainer``'s elements, in pixels.
  82. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  83. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  84. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  85. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  86. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  87. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`