--- widget inputs
here are the various ways of specifying widget inputs:
format | example | description |
---|---|---|
<number> | 5.3 | a number |
#RRGGBB | #ff831c | a 3-component vector whose values are taken from the given color code. a color picker will be shown next to the input. |
#RRGGBBAA | #ff831c22 | a 4-component vector whose values are taken from the color code. |
<widget name> | add1 | the output from another widget |
<input>,<input> | .pos,0 | a vector composed of a and b (which can themselves be vectors) |
<input>.<component> | .pos.x | extract a single component from a vector |
<input>.<swizzle> | .pos.yxy | reorder vector components (this example is equivalent to .pos.y, .pos.x, .pos.y ) |
.
to distinguish
them from your widgets.
here they all are.
below, float
refers to a plain old number,
vec2
is a 2-component vector, etc.
built‑in | type | description |
---|---|---|
.pos | vec2 | the position of the pixel, with (−1, −1) being the bottom-left corner, and (+1, +1) being the top-right corner. |
.pos01 | vec2 | the position of the pixel, with (0, 0) being the bottom-left corner, and (+1, +1) being the top-right corner. |
.time | float | the amount of time that has passed (wraps around every hour to prevent imprecision issues). |
.mouse | vec2 | the position of the mouse ranging from (−1, −1) to (+1, +1). |
.mouse01 | vec2 | the position of the mouse ranging from (0, 0) to (+1, +1). |
.pi | float | π (3.1415…). |
.2pi | float | 2π (6.2831…). |