Skip to content

Components

Clip

Clips everything under this node to a rectangle: a scrolling list inside a panel, a health bar that fills, a window with a view through it. A rotated clip is cut to its rectangle's bounding box, not its rotated shape.

On this page

Add it

+ Add node → Clip, Scroll View creates a node with it already on. Already have a node for it? Add component → ClipComponent.

From a script

A script on the same node writes these fields by name. ClipComponent is the name to pass.

rgs
set_point("ClipComponent", "size", vec2(128.0, 128.0));
set_point("ClipComponent", "anchor", vec2(0.5, 0.5));
set_flag("ClipComponent", "enabled", true);

Fields

FieldScript nameKindDefaultWhat it does
Sizesizetwo numbers (x, y)(128, 128)The size of the rectangle it clips to, in local units, on a node in the room; an interface node clips to its own rect instead.
Anchoranchortwo numbers (x, y), 0 to 1, step 0.01(0.5, 0.5)Where that rectangle sits on the node, from (0, 0) at the top-left to (0.5, 0.5) at the centre, on a node in the room; an interface node clips to its own rect instead.
EnabledenabledcheckboxonWhether it clips right now.