Files
godot-docs-l10n/classes/zh_Hant/class_flowcontainer.rst

285 lines
11 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_FlowContainer:
FlowContainer
=============
**繼承:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**被繼承:** :ref:`HFlowContainer<class_HFlowContainer>`, :ref:`VFlowContainer<class_VFlowContainer>`
將子控制項橫向或縱向排列並在邊界處換行的容器。
.. rst-class:: classref-introduction-group
說明
----
將子控制項橫向或縱向排列並在邊界處換行的容器。類似於書本中文字在一行中寫不下以後的換行方式。
.. rst-class:: classref-introduction-group
教學
----
- :doc:`使用容器 <../tutorials/ui/gui_containers>`
.. rst-class:: classref-reftable-group
屬性
----
.. table::
:widths: auto
+------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` | :ref:`alignment<class_FlowContainer_property_alignment>` | ``0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` | :ref:`last_wrap_alignment<class_FlowContainer_property_last_wrap_alignment>` | ``0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`reverse_fill<class_FlowContainer_property_reverse_fill>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`vertical<class_FlowContainer_property_vertical>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-----------------------+--------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_line_count<class_FlowContainer_method_get_line_count>`\ (\ ) |const| |
+-----------------------+--------------------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
主題屬性
--------
.. table::
:widths: auto
+-----------------------+----------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`h_separation<class_FlowContainer_theme_constant_h_separation>` | ``4`` |
+-----------------------+----------------------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`v_separation<class_FlowContainer_theme_constant_v_separation>` | ``4`` |
+-----------------------+----------------------------------------------------------------------+-------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
列舉
----
.. _enum_FlowContainer_AlignmentMode:
.. rst-class:: classref-enumeration
enum **AlignmentMode**: :ref:`🔗<enum_FlowContainer_AlignmentMode>`
.. _class_FlowContainer_constant_ALIGNMENT_BEGIN:
.. rst-class:: classref-enumeration-constant
:ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
子控制項會被排列在該容器的開頭如果是垂直朝向則為頂部如果是水平朝向則為左側RTL 佈局時為右側)。
.. _class_FlowContainer_constant_ALIGNMENT_CENTER:
.. rst-class:: classref-enumeration-constant
:ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
子控制項會在該容器裡居中。
.. _class_FlowContainer_constant_ALIGNMENT_END:
.. rst-class:: classref-enumeration-constant
:ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **ALIGNMENT_END** = ``2``
子控制項會被排列在該容器的末尾如果是垂直朝向則為底部如果是水平朝向則為右側RTL 佈局時為左側)。
.. rst-class:: classref-item-separator
----
.. _enum_FlowContainer_LastWrapAlignmentMode:
.. rst-class:: classref-enumeration
enum **LastWrapAlignmentMode**: :ref:`🔗<enum_FlowContainer_LastWrapAlignmentMode>`
.. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_INHERIT:
.. rst-class:: classref-enumeration-constant
:ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_INHERIT** = ``0``
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>`.
.. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_BEGIN:
.. rst-class:: classref-enumeration-constant
:ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_BEGIN** = ``1``
The last partially filled row or column will wrap aligned to the beginning of the previous row or column.
.. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_CENTER:
.. rst-class:: classref-enumeration-constant
:ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_CENTER** = ``2``
The last partially filled row or column will wrap aligned to the center of the previous row or column.
.. _class_FlowContainer_constant_LAST_WRAP_ALIGNMENT_END:
.. rst-class:: classref-enumeration-constant
:ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **LAST_WRAP_ALIGNMENT_END** = ``3``
The last partially filled row or column will wrap aligned to the end of the previous row or column.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
屬性說明
--------
.. _class_FlowContainer_property_alignment:
.. rst-class:: classref-property
:ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **alignment** = ``0`` :ref:`🔗<class_FlowContainer_property_alignment>`
.. rst-class:: classref-property-setget
- |void| **set_alignment**\ (\ value\: :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>`\ )
- :ref:`AlignmentMode<enum_FlowContainer_AlignmentMode>` **get_alignment**\ (\ )
該容器子節點的對齊方式(必須是 :ref:`ALIGNMENT_BEGIN<class_FlowContainer_constant_ALIGNMENT_BEGIN>`\ 、\ :ref:`ALIGNMENT_CENTER<class_FlowContainer_constant_ALIGNMENT_CENTER>`\ 、\ :ref:`ALIGNMENT_END<class_FlowContainer_constant_ALIGNMENT_END>` 之一)。
.. rst-class:: classref-item-separator
----
.. _class_FlowContainer_property_last_wrap_alignment:
.. rst-class:: classref-property
:ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **last_wrap_alignment** = ``0`` :ref:`🔗<class_FlowContainer_property_last_wrap_alignment>`
.. rst-class:: classref-property-setget
- |void| **set_last_wrap_alignment**\ (\ value\: :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>`\ )
- :ref:`LastWrapAlignmentMode<enum_FlowContainer_LastWrapAlignmentMode>` **get_last_wrap_alignment**\ (\ )
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>`).
.. rst-class:: classref-item-separator
----
.. _class_FlowContainer_property_reverse_fill:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **reverse_fill** = ``false`` :ref:`🔗<class_FlowContainer_property_reverse_fill>`
.. rst-class:: classref-property-setget
- |void| **set_reverse_fill**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_reverse_fill**\ (\ )
If ``true``, reverses fill direction. Horizontal **FlowContainer**\ s will fill rows bottom to top, vertical **FlowContainer**\ s will fill columns right to left.
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.
.. rst-class:: classref-item-separator
----
.. _class_FlowContainer_property_vertical:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **vertical** = ``false`` :ref:`🔗<class_FlowContainer_property_vertical>`
.. rst-class:: classref-property-setget
- |void| **set_vertical**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_vertical**\ (\ )
如果為 ``true``\ ,則 **FlowContainer** 將垂直排列子節點,而不是水平排列。
使用 :ref:`HFlowContainer<class_HFlowContainer>` 和 :ref:`VFlowContainer<class_VFlowContainer>` 時不能改變。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法說明
--------
.. _class_FlowContainer_method_get_line_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`🔗<class_FlowContainer_method_get_line_count>`
返回目前的行數。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
主題屬性說明
------------
.. _class_FlowContainer_theme_constant_h_separation:
.. rst-class:: classref-themeproperty
:ref:`int<class_int>` **h_separation** = ``4`` :ref:`🔗<class_FlowContainer_theme_constant_h_separation>`
The horizontal separation of child nodes.
.. rst-class:: classref-item-separator
----
.. _class_FlowContainer_theme_constant_v_separation:
.. rst-class:: classref-themeproperty
:ref:`int<class_int>` **v_separation** = ``4`` :ref:`🔗<class_FlowContainer_theme_constant_v_separation>`
The vertical separation of child nodes.
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
.. |void| replace:: :abbr:`void (無回傳值。)`