class_flowcontainer.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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/FlowContainer.xml.
  6. .. _class_FlowContainer:
  7. FlowContainer
  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:`HFlowContainer<class_HFlowContainer>`, :ref:`VFlowContainer<class_VFlowContainer>`
  11. A container that arranges its child controls horizontally or vertically and wraps them around at the borders.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A container that arranges its child controls horizontally or vertically and wraps them around at the borders. This is similar to how text in a book wraps around when no more words can fit on a line.
  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_FlowContainer_AlignmentMode>` | :ref:`alignment<class_FlowContainer_property_alignment>` | ``0`` |
  27. +------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
  28. | :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` | :ref:`last_wrap_alignment<class_FlowContainer_property_last_wrap_alignment>` | ``0`` |
  29. +------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
  30. | :ref:`bool<class_bool>` | :ref:`reverse_fill<class_FlowContainer_property_reverse_fill>` | ``false`` |
  31. +------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`vertical<class_FlowContainer_property_vertical>` | ``false`` |
  33. +------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +-----------------------+--------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_line_count<class_FlowContainer_method_get_line_count>`\ (\ ) |const| |
  41. +-----------------------+--------------------------------------------------------------------------------+
  42. .. rst-class:: classref-reftable-group
  43. Theme Properties
  44. ----------------
  45. .. table::
  46. :widths: auto
  47. +-----------------------+----------------------------------------------------------------------+-------+
  48. | :ref:`int<class_int>` | :ref:`h_separation<class_FlowContainer_theme_constant_h_separation>` | ``4`` |
  49. +-----------------------+----------------------------------------------------------------------+-------+
  50. | :ref:`int<class_int>` | :ref:`v_separation<class_FlowContainer_theme_constant_v_separation>` | ``4`` |
  51. +-----------------------+----------------------------------------------------------------------+-------+
  52. .. rst-class:: classref-section-separator
  53. ----
  54. .. rst-class:: classref-descriptions-group
  55. Enumerations
  56. ------------
  57. .. _enum_FlowContainer_AlignmentMode:
  58. .. rst-class:: classref-enumeration
  59. enum **AlignmentMode**: :ref:`🔗<enum_FlowContainer_AlignmentMode>`
  60. .. _class_FlowContainer_constant_ALIGNMENT_BEGIN:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
  63. 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).
  64. .. _class_FlowContainer_constant_ALIGNMENT_CENTER:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
  67. The child controls will be centered in the container.
  68. .. _class_FlowContainer_constant_ALIGNMENT_END:
  69. .. rst-class:: classref-enumeration-constant
  70. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_END** = ``2``
  71. 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).
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _enum_FlowContainer_LastWrapAlignmentMode:
  75. .. rst-class:: classref-enumeration
  76. enum **LastWrapAlignmentMode**: :ref:`🔗<enum_FlowContainer_LastWrapAlignmentMode>`
  77. .. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_INHERIT:
  78. .. rst-class:: classref-enumeration-constant
  79. :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_INHERIT** = ``0``
  80. The last partially filled row or column will wrap aligned to the previous row or column in accordance with :ref:`alignment<class_FlowContainer_property_alignment>`.
  81. .. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_BEGIN:
  82. .. rst-class:: classref-enumeration-constant
  83. :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_BEGIN** = ``1``
  84. The last partially filled row or column will wrap aligned to the beginning of the previous row or column.
  85. .. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_CENTER:
  86. .. rst-class:: classref-enumeration-constant
  87. :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_CENTER** = ``2``
  88. The last partially filled row or column will wrap aligned to the center of the previous row or column.
  89. .. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_END:
  90. .. rst-class:: classref-enumeration-constant
  91. :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_END** = ``3``
  92. The last partially filled row or column will wrap aligned to the end of the previous row or column.
  93. .. rst-class:: classref-section-separator
  94. ----
  95. .. rst-class:: classref-descriptions-group
  96. Property Descriptions
  97. ---------------------
  98. .. _class_FlowContainer_property_alignment:
  99. .. rst-class:: classref-property
  100. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **alignment** = ``0`` :ref:`🔗<class_FlowContainer_property_alignment>`
  101. .. rst-class:: classref-property-setget
  102. - |void| **set_alignment**\ (\ value\: :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>`\ )
  103. - :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **get_alignment**\ (\ )
  104. The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN<class_FlowContainer_constant_ALIGNMENT_BEGIN>`, :ref:`ALIGNMENT_CENTER<class_FlowContainer_constant_ALIGNMENT_CENTER>`, or :ref:`ALIGNMENT_END<class_FlowContainer_constant_ALIGNMENT_END>`).
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_FlowContainer_property_last_wrap_alignment:
  108. .. rst-class:: classref-property
  109. :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **last_wrap_alignment** = ``0`` :ref:`🔗<class_FlowContainer_property_last_wrap_alignment>`
  110. .. rst-class:: classref-property-setget
  111. - |void| **set_last_wrap_alignment**\ (\ value\: :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>`\ )
  112. - :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **get_last_wrap_alignment**\ (\ )
  113. The wrap behavior of the last, partially filled row or column (must be one of :ref:`LAST_WRAP_ALIGNMENT_INHERIT<class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_INHERIT>`, :ref:`LAST_WRAP_ALIGNMENT_BEGIN<class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_BEGIN>`, :ref:`LAST_WRAP_ALIGNMENT_CENTER<class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_CENTER>`, or :ref:`LAST_WRAP_ALIGNMENT_END<class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_END>`).
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_FlowContainer_property_reverse_fill:
  117. .. rst-class:: classref-property
  118. :ref:`bool<class_bool>` **reverse_fill** = ``false`` :ref:`🔗<class_FlowContainer_property_reverse_fill>`
  119. .. rst-class:: classref-property-setget
  120. - |void| **set_reverse_fill**\ (\ value\: :ref:`bool<class_bool>`\ )
  121. - :ref:`bool<class_bool>` **is_reverse_fill**\ (\ )
  122. If ``true``, reverses fill direction. Horizontal **FlowContainer**\ s will fill rows bottom to top, vertical **FlowContainer**\ s will fill columns right to left.
  123. When using a vertical **FlowContainer** with a right to left :ref:`Control.layout_direction<class_Control_property_layout_direction>`, columns will fill left to right instead.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_FlowContainer_property_vertical:
  127. .. rst-class:: classref-property
  128. :ref:`bool<class_bool>` **vertical** = ``false`` :ref:`🔗<class_FlowContainer_property_vertical>`
  129. .. rst-class:: classref-property-setget
  130. - |void| **set_vertical**\ (\ value\: :ref:`bool<class_bool>`\ )
  131. - :ref:`bool<class_bool>` **is_vertical**\ (\ )
  132. If ``true``, the **FlowContainer** will arrange its children vertically, rather than horizontally.
  133. Can't be changed when using :ref:`HFlowContainer<class_HFlowContainer>` and :ref:`VFlowContainer<class_VFlowContainer>`.
  134. .. rst-class:: classref-section-separator
  135. ----
  136. .. rst-class:: classref-descriptions-group
  137. Method Descriptions
  138. -------------------
  139. .. _class_FlowContainer_method_get_line_count:
  140. .. rst-class:: classref-method
  141. :ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`🔗<class_FlowContainer_method_get_line_count>`
  142. Returns the current line count.
  143. .. rst-class:: classref-section-separator
  144. ----
  145. .. rst-class:: classref-descriptions-group
  146. Theme Property Descriptions
  147. ---------------------------
  148. .. _class_FlowContainer_theme_constant_h_separation:
  149. .. rst-class:: classref-themeproperty
  150. :ref:`int<class_int>` **h_separation** = ``4`` :ref:`🔗<class_FlowContainer_theme_constant_h_separation>`
  151. The horizontal separation of child nodes.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_FlowContainer_theme_constant_v_separation:
  155. .. rst-class:: classref-themeproperty
  156. :ref:`int<class_int>` **v_separation** = ``4`` :ref:`🔗<class_FlowContainer_theme_constant_v_separation>`
  157. The vertical separation of child nodes.
  158. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  159. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  160. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  161. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  162. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  163. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  164. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  165. .. |void| replace:: :abbr:`void (No return value.)`