beam
A glowing beam of light between two points.
beam(slots: {
from: PropRef
to: PropRef
thickness: {start: ArgSpec; end: ArgSpec}
softness: {start: ArgSpec; end: ArgSpec}
colors: {inside: PropRef; outside: PropRef}
space: PropRef
}): Paint
Import gradients from shaders/std and use gradients.beam.
from and to are position props (made with transformPosition). thickness (0–2) and softness each take a start and end value so the beam can taper. The cross-section shades from colors.inside at the core to colors.outside at the edge, mixed in the color space named by the space prop (mark it compileTime). Declare extraFields: beamPreconvertedFields on the definition.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | `{ |
from: PropRef
to: PropRef
thickness: {start: ArgSpec; end: ArgSpec}
softness: {start: ArgSpec; end: ArgSpec}
colors: {inside: PropRef; outside: PropRef}
space: PropRef
}` | |
Example
paint: beam({from: p('startPosition'), to: p('endPosition'), thickness: {start: p('startThickness'), end: p('endThickness')}, softness: {start: p('startSoftness'), end: p('endSoftness')}, colors: {inside: p('insideColor'), outside: p('outsideColor')}, space: p('colorSpace')})
See also
beamPreconvertedFields— TheextraFieldsabeamdefinition must declare.