Shape
An untextured rectangle, circle or capsule with an optional outline, for blocking out a room's layout before any art exists.
On this page
Add it
+ Add node โ Shape, Block, Character creates a node with it already on. Already have a node for it? Add component โ ShapeComponent.
From a script
A script on the same node writes these fields by name. ShapeComponent is the name to pass.
rgs
set_point("ShapeComponent", "size", vec2(64.0, 64.0));
set_point("ShapeComponent", "anchor", vec2(0.5, 0.5));
set_colour("ShapeComponent", "color", vec4(0.42, 0.55, 0.86, 1.0));
set_number("ShapeComponent", "outline", 0.0);
set_colour("ShapeComponent", "outline_color", vec4(1.0, 1.0, 1.0, 1.0)); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Kind | kind | one of Rectangle, Circle, Capsule | Rectangle | Which shape. |
| Size | size | two numbers (x, y) | (64, 64) | Size in local units before the node transform. |
| Anchor | anchor | two numbers (x, y), 0 to 1, step 0.01 | (0.5, 0.5) | Anchor point on the shape: 0, 0 is the top-left corner, 0.5, 0.5 is the centre. |
| Color | color | colour | #6b8cdb | Fill colour for the shape. |
| Outline | outline | number, at least 0, step 0.5 | 0 | Zero draws no outline. An outlined Circle or Capsule draws as a mesh, behind a Rectangle or a sprite on the same Sort Layer: front and back on one Sort Layer is not the hierarchy โ put it on its own layer. |
| Outline Color | outline_color | colour | #ffffff | Outline colour. |
| Sort Layer | layer | number | 0 | Lower draws first. |