Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

FlowContainer

繼承: Container < Control < CanvasItem < Node < Object

被繼承: HFlowContainer, VFlowContainer

將子控制項橫向或縱向排列並在邊界處換行的容器。

說明

將子控制項橫向或縱向排列並在邊界處換行的容器。類似於書本中文字在一行中寫不下以後的換行方式。

教學

屬性

AlignmentMode

alignment

0

LastWrapAlignmentMode

last_wrap_alignment

0

bool

reverse_fill

false

bool

vertical

false

方法

int

get_line_count() const

主題屬性

int

h_separation

4

int

v_separation

4


列舉

enum AlignmentMode: 🔗

AlignmentMode ALIGNMENT_BEGIN = 0

子控制項會被排列在該容器的開頭,如果是垂直朝向則為頂部,如果是水平朝向則為左側(RTL 佈局時為右側)。

AlignmentMode ALIGNMENT_CENTER = 1

子控制項會在該容器裡居中。

AlignmentMode ALIGNMENT_END = 2

子控制項會被排列在該容器的末尾,如果是垂直朝向則為底部,如果是水平朝向則為右側(RTL 佈局時為左側)。


enum LastWrapAlignmentMode: 🔗

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 alignment.

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.

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.

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.


屬性說明

AlignmentMode alignment = 0 🔗

該容器子節點的對齊方式(必須是 ALIGNMENT_BEGINALIGNMENT_CENTERALIGNMENT_END 之一)。


LastWrapAlignmentMode last_wrap_alignment = 0 🔗

The wrap behavior of the last, partially filled row or column (must be one of LAST_WRAP_ALIGNMENT_INHERIT, LAST_WRAP_ALIGNMENT_BEGIN, LAST_WRAP_ALIGNMENT_CENTER, or LAST_WRAP_ALIGNMENT_END).


bool reverse_fill = false 🔗

  • void set_reverse_fill(value: bool)

  • bool is_reverse_fill()

If true, reverses fill direction. Horizontal FlowContainers will fill rows bottom to top, vertical FlowContainers will fill columns right to left.

When using a vertical FlowContainer with a right to left Control.layout_direction, columns will fill left to right instead.


bool vertical = false 🔗

  • void set_vertical(value: bool)

  • bool is_vertical()

如果為 true,則 FlowContainer 將垂直排列子節點,而不是水平排列。

使用 HFlowContainerVFlowContainer 時不能改變。


方法說明

int get_line_count() const 🔗

返回目前的行數。


主題屬性說明

int h_separation = 4 🔗

The horizontal separation of child nodes.


int v_separation = 4 🔗

The vertical separation of child nodes.