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...
GridContainer¶
继承: Container < Control < CanvasItem < Node < Object
将子控件按照网格布局排列的容器。
描述¶
GridContainer 会将其子控件按照网格布局排列。网格的列数由 columns 属性指定,行数取决于容器中子控件的数量。将保留每个大小的容器的列和行。
注意:GridContainer 只对继承自 Control 的子节点生效。它不会重新排列继承自 Node2D 的子节点。
教程¶
属性¶
|
主题属性¶
|
||
|
属性说明¶
int columns = 1
GridContainer 中的列数。修改后,GridContainer 会重新排列其派生自 Control 的子节点,以适应新的布局。
主题属性说明¶
int h_separation = 4
子节点的水平分隔量。
int v_separation = 4
子节点的垂直分隔量。