Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
Kindkindone of Rectangle, Circle, CapsuleRectangleWhich shape.
Sizesizetwo numbers (x, y)(64, 64)Size in local units before the node transform.
Anchoranchortwo 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.
Colorcolorcolour#6b8cdbFill colour for the shape.
Outlineoutlinenumber, at least 0, step 0.50Zero 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 Coloroutline_colorcolour#ffffffOutline colour.
Sort Layerlayernumber0Lower draws first.