line2d
A stroked line at the node through the points of a mesh or path2d asset, tinted by color and drawn with texture.
Ezen az oldalon
2d · render · 13 properties · 2D
A stroked line at the node through the points of a mesh or path2d asset, tinted by color and drawn with texture.
In a scene, line2d is the node key that applies it. A script reaches each property below as a field on node.line2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.line2d.get() and node.line2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
cap |
enum | round |
How an open line ends One of round, butt, square. |
closed |
bool | false |
Join the last point back to the first, making a polygon outline |
color |
color | [0.8,0.8,0.8,1] |
Tint, as channel floats or #rrggbb / #rrggbbaa |
gradient |
color | [0,0,0,0] |
The colour the line fades to at its far end, from color at its start; a zero alpha means no gradient |
gradient_steps |
int | 32 |
How many colours the gradient steps through along the line At least 1. |
join |
enum | round |
How the line's segments meet One of round, miter, bevel. |
material |
asset · material |
— | The material this draws with; empty draws with the built-in one |
mesh |
asset · mesh |
— | Where the line's points come from: a mesh asset's vertices, or a path2d asset, which is sampled into points and so draws as a stroked curve |
miter_limit |
float | 4 |
How far a miter join may reach, in half-widths, before its corner is cut to a bevel At least 1. |
segments |
int | 32 |
Cuts around a round join or cap At least 3. |
taper |
vec2 | [1,1] |
Multipliers on width at the line's start and end, blended along it; anything but [1, 1] draws round joins and caps |
texture |
asset · texture |
— | An image, or a texture asset, the line draws with, repeating once per world unit of its length |
width |
float | 0.02 |
Line thickness in world units At least 0.001. |
Asset types this component references: material, mesh, texture.