Grid
Arranges children in rows and columns — an inventory, a level select — where a Stack's one axis is not enough. Fit decides the column count: a fixed number, or as many fixed-size cells as fit the width. Goes under a Canvas.
On this page
Add it
+ Add node → Grid creates a node with it already on. Already have a node for it? Add component → GridComponent.
From a script
A script on the same node writes these fields by name. GridComponent is the name to pass.
rgs
set_point("GridComponent", "cell", vec2(64.0, 64.0));
set_point("GridComponent", "spacing", vec2(8.0, 8.0));
set_number("GridComponent", "padding", 0.0); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Fit | fit | one of Columns, Cell | Columns | What decides the column count. |
| Columns | columns | number, at least 1 | 4 | Only used by the Columns fit. |
| Cell | cell | two numbers (x, y) | (64, 64) | Cell size in UI units. |
| Spacing | spacing | two numbers (x, y), at least 0 | (8, 8) | Gap between cells, in UI units. |
| Padding | padding | number, at least 0 | 0 | Inset from the grid's own box on every side, in UI units. |