Overview
A single-purpose node that draws a pixel-perfect straight line between two points using Bresenham's algorithm. Use it for numerically driven lines defined by coordinates, such as lasers, ropes, gauges, and reticles.
Usage tips
- Promote the endpoints to input pins 📌 and connect coordinates from a waveform
or
path_sampleto create a moving line such as a beam or connecting rope. - Curves and complex shapes belong to
bezier_path+path_stroke. This node's advantage is the convenience of drawing from two numeric pairs. - Thicknesses of 2px or more are expanded with a circular brush. A horizontal or
vertical line has a cross-section exactly as wide as the requested
thickness.
Related nodes
path_stroke— draws curved or styled linesshape_generate— draws other basic shapesexpression_vec2— calculates endpoint coordinatesblend— composites the line over a background
Canvas-size binding
As a generator node, new instances automatically bind width / height to the
project canvas size (_canvasWidth / _canvasHeight).
The initial endpoint of a new instance is also placed on the current bottom-right
pixel (x2 = width - 1, y2 = height - 1). The endpoint itself is not bound and
remains freely editable afterward.
| State | width/height value |
|---|---|
| Default (new instance) | Bound to the project canvas size and follows it automatically |
| Entered manually or unbound by the user | Local value independent of the canvas size |
Use the 🔗 button in the Inspector to remove or recreate the binding.
Algorithm
- 1px thickness: Bresenham's line algorithm (exact pixel line)
- 2px or more: applies a circular brush at each Bresenham point
- Odd-sized brushes are symmetric around the line coordinate.
- An even-sized brush cannot be perfectly symmetric on integer pixel centers, so its
center is fixed 0.5px down and right from the line coordinate. For example, a
2px brush occupies offsets
0, +1, while a 4px brush occupies-1, 0, +1, +2. - Brush pixels outside the canvas are clipped.
Examples
- LineGenerate → Blend → Preview — draw a straight line
- TimeSource → SineWave → Remap → LineGenerate(x2) → AnimationRender — animate line endpoints
- ColorPicker → LineGenerate(color) — draw a line in any color