class_flowcontainer.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/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:`bool<class_bool>` | :ref:`vertical<class_FlowContainer_property_vertical>` | ``false`` |
  29. +--------------------------------------------------------+----------------------------------------------------------+-----------+
  30. .. rst-class:: classref-reftable-group
  31. Methods
  32. -------
  33. .. table::
  34. :widths: auto
  35. +-----------------------+--------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_line_count<class_FlowContainer_method_get_line_count>` **(** **)** |const| |
  37. +-----------------------+--------------------------------------------------------------------------------------+
  38. .. rst-class:: classref-reftable-group
  39. Theme Properties
  40. ----------------
  41. .. table::
  42. :widths: auto
  43. +-----------------------+----------------------------------------------------------------------+-------+
  44. | :ref:`int<class_int>` | :ref:`h_separation<class_FlowContainer_theme_constant_h_separation>` | ``4`` |
  45. +-----------------------+----------------------------------------------------------------------+-------+
  46. | :ref:`int<class_int>` | :ref:`v_separation<class_FlowContainer_theme_constant_v_separation>` | ``4`` |
  47. +-----------------------+----------------------------------------------------------------------+-------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Enumerations
  52. ------------
  53. .. _enum_FlowContainer_AlignmentMode:
  54. .. rst-class:: classref-enumeration
  55. enum **AlignmentMode**:
  56. .. _class_FlowContainer_constant_ALIGNMENT_BEGIN:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
  59. 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).
  60. .. _class_FlowContainer_constant_ALIGNMENT_CENTER:
  61. .. rst-class:: classref-enumeration-constant
  62. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
  63. The child controls will be centered in the container.
  64. .. _class_FlowContainer_constant_ALIGNMENT_END:
  65. .. rst-class:: classref-enumeration-constant
  66. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_END** = ``2``
  67. 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).
  68. .. rst-class:: classref-section-separator
  69. ----
  70. .. rst-class:: classref-descriptions-group
  71. Property Descriptions
  72. ---------------------
  73. .. _class_FlowContainer_property_alignment:
  74. .. rst-class:: classref-property
  75. :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **alignment** = ``0``
  76. .. rst-class:: classref-property-setget
  77. - void **set_alignment** **(** :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` value **)**
  78. - :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **get_alignment** **(** **)**
  79. 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>`).
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_FlowContainer_property_vertical:
  83. .. rst-class:: classref-property
  84. :ref:`bool<class_bool>` **vertical** = ``false``
  85. .. rst-class:: classref-property-setget
  86. - void **set_vertical** **(** :ref:`bool<class_bool>` value **)**
  87. - :ref:`bool<class_bool>` **is_vertical** **(** **)**
  88. If ``true``, the **FlowContainer** will arrange its children vertically, rather than horizontally.
  89. Can't be changed when using :ref:`HFlowContainer<class_HFlowContainer>` and :ref:`VFlowContainer<class_VFlowContainer>`.
  90. .. rst-class:: classref-section-separator
  91. ----
  92. .. rst-class:: classref-descriptions-group
  93. Method Descriptions
  94. -------------------
  95. .. _class_FlowContainer_method_get_line_count:
  96. .. rst-class:: classref-method
  97. :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  98. Returns the current line count.
  99. .. rst-class:: classref-section-separator
  100. ----
  101. .. rst-class:: classref-descriptions-group
  102. Theme Property Descriptions
  103. ---------------------------
  104. .. _class_FlowContainer_theme_constant_h_separation:
  105. .. rst-class:: classref-themeproperty
  106. :ref:`int<class_int>` **h_separation** = ``4``
  107. The horizontal separation of child nodes.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_FlowContainer_theme_constant_v_separation:
  111. .. rst-class:: classref-themeproperty
  112. :ref:`int<class_int>` **v_separation** = ``4``
  113. The vertical separation of child nodes.
  114. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  115. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  116. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  117. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  118. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  119. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  120. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`