From eaff50ee1fb64f236ba715d2099a3a3011280c08 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 30 Aug 2023 00:15:41 -0400 Subject: change up guide a bit --- guide-src/widget-inputs.html | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 guide-src/widget-inputs.html (limited to 'guide-src/widget-inputs.html') diff --git a/guide-src/widget-inputs.html b/guide-src/widget-inputs.html new file mode 100644 index 0000000..f0e8bdb --- /dev/null +++ b/guide-src/widget-inputs.html @@ -0,0 +1,41 @@ +--- widget inputs + +

syntax

+ +

+here are the various ways of specifying widget inputs: +

+ + + + + + + + + + + +
formatexampledescription
<number>5.3a number
#RRGGBB#ff831ca 3-component vector whose values are taken from the given color code. a color picker will be shown next to the input.
#RRGGBBAA#ff831c22a 4-component vector whose values are taken from the color code.
<widget name>add1the output from another widget
<input>,<input>.pos,0a vector composed of a and b (which can themselves be vectors)
<input>.<component>.pos.xextract a single component from a vector
<input>.<swizzle>.pos.yxyreorder vector components (this example is equivalent to .pos.y, .pos.x, .pos.y)
+ + +

built-in values

+ +all of pugl's built-in values begin with a . 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‑intypedescription
.posvec2the position of the pixel, with (−1, −1) being the bottom-left corner, and (+1, +1) being the top-right corner.
.pos01vec2the position of the pixel, with (0, 0) being the bottom-left corner, and (+1, +1) being the top-right corner.
.timefloatthe amount of time that has passed (wraps around every hour to prevent imprecision issues).
.mousevec2the position of the mouse ranging from (−1, −1) to (+1, +1).
.mouse01vec2the position of the mouse ranging from (0, 0) to (+1, +1).
.pifloatπ (3.1415…).
.2pifloat2π (6.2831…).
-- cgit v1.2.3