Line
A stroked line drawn through a list of points: a rope, a cable, a beam, or a grapple's line stretched between two points that move every frame. Set its width, colour and how joints and ends are finished.
On this page
Add it
+ Add node → Line creates a node with it already on. Already have a node for it? Add component → LineComponent.
From a script
A script on the same node writes these fields by name. LineComponent is the name to pass.
rgs
set_number("LineComponent", "width", 4.0);
set_colour("LineComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_flag("LineComponent", "closed", false); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Points | points | list | empty | The points, in order, in local units. |
| Width | width | number, at least 0 | 4 | Stroke width in local units. |
| Color | color | colour | #ffffff | Tint colour, alpha included. |
| Joint | joint | one of Flat, Round, RoundCaps | Flat | How corners and ends are finished. |
| Closed | closed | checkbox | off | Whether the last point joins back to the first. |
| Sort Layer | layer | number | 0 | Lower draws first. |