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.
Checking the stable version of the documentation...
FlowContainer
继承: Container < Control < CanvasItem < Node < Object
派生: HFlowContainer, VFlowContainer
将子控件横向或纵向排列并在边界处换行的容器。
描述
将子控件横向或纵向排列并在边界处换行的容器。类似于书本中文字在一行中写不下以后的换行方式。
教程
属性
|
||
|
||
|
||
|
方法
get_line_count() const |
主题属性
|
||
|
枚举
enum AlignmentMode: 🔗
AlignmentMode ALIGNMENT_BEGIN = 0
子控件会被排列在该容器的开头,如果是垂直朝向则为顶部,如果是水平朝向则为左侧(RTL 布局时为右侧)。
AlignmentMode ALIGNMENT_CENTER = 1
子控件会在该容器里居中。
AlignmentMode ALIGNMENT_END = 2
子控件会被排列在该容器的末尾,如果是垂直朝向则为底部,如果是水平朝向则为右侧(RTL 布局时为左侧)。
enum LastWrapAlignmentMode: 🔗
LastWrapAlignmentMode LAST_WRAP_ALIGNMENT_INHERIT = 0
最后部分填充的行或列将按照 alignment 与前一行或前一列对齐。
LastWrapAlignmentMode LAST_WRAP_ALIGNMENT_BEGIN = 1
最后部分填充的行或列将会与前一行或前一列的开头对齐。
LastWrapAlignmentMode LAST_WRAP_ALIGNMENT_CENTER = 2
最后部分填充的行或列将会与前一行或前一列的中心对齐。
LastWrapAlignmentMode LAST_WRAP_ALIGNMENT_END = 3
最后部分填充的行或列将会与前一行或前一列的末尾对齐。
属性说明
AlignmentMode alignment = 0
🔗
void set_alignment(value: AlignmentMode)
AlignmentMode get_alignment()
该容器子节点的对齐方式(必须是 ALIGNMENT_BEGIN、ALIGNMENT_CENTER、ALIGNMENT_END 之一)。
LastWrapAlignmentMode last_wrap_alignment = 0
🔗
void set_last_wrap_alignment(value: LastWrapAlignmentMode)
LastWrapAlignmentMode get_last_wrap_alignment()
最后一个未填满的行/列的对齐方式(必须是 LAST_WRAP_ALIGNMENT_INHERIT、LAST_WRAP_ALIGNMENT_BEGIN、LAST_WRAP_ALIGNMENT_CENTER、LAST_WRAP_ALIGNMENT_END 之一)。
如果为 true
,则翻转填充方向。水平的 FlowContainer 会从下往上一行行填充,垂直的 FlowContainer 会从右往左一列列填充。
如果使用的是垂直的 FlowContainer 和从右至左的 Control.layout_direction,则会从左往右一列列填充。
如果为 true
,则 FlowContainer 将垂直排列子节点,而不是水平排列。
使用 HFlowContainer 和 VFlowContainer 时不能改变。
方法说明
返回当前的行数。
主题属性说明
子节点的水平分隔量。
子节点的垂直分隔量。