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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Size | size | two 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. |
| Anchor | anchor | two 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. |
| Enabled | enabled | checkbox | on | Whether it clips right now. |