Skip to content

Line

A polyline through local points: width, colour, closed, rounded joints (lasers, ropes, outlines).

Type: LineNode · Category: Graphics & Rendering · Also found as: line, line2d

Property Type Default Description
width number 4 Line thickness (px). Range 0.5 to 100.
color color #ffffffff Line colour.
closed boolean false Join the last point to the first.
rounded boolean true Round joints and caps.

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("width")
  • path LineNodeProperty|string

Returns any

Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.” a field of the node’s script.

self.node:set_property("width", 1.5)
  • path LineNodeProperty|string
  • value any
  • y? number

LineNode: replaces its points (local to the node).

self.node:get_node("Laser"):line_set_points({ {0, 0}, {120, 0} })
  • points number[][] { {x, y}, … }

LineNode: appends a point (local to the node).

self.node:get_node("Path"):line_add_point(64, 32)
  • x number
  • y number

LineNode: removes every point.

self.node:get_node("Path"):line_clear()
{
"type": "LineNode",
"name": "Line",
"position": [
0,
0
],
"properties": {
"width": 4,
"color": "#ffffffff",
"closed": false
}
}