summaryrefslogtreecommitdiff
path: root/guide-src/widget-inputs/builtins.html
blob: 32cb3b109a13985377d3129a9cd38530cb759680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- built-in values

all of pugl's built-in values begin with a <code>.</code> to distinguish
them from your widgets.
here they all are.
below, <code>float</code> refers to a plain old number,
<code>vec2</code> is a 2-component vector, etc.

<table>
<tbody>
<tr><th>built‑in</th><th>type</th><th>description</th></tr>
<tr><td><code>.pos</code></td><td><code>vec2</code><td>the position of the pixel, with (−1, −1) being the bottom-left corner, and (+1, +1) being the top-right corner.</td></tr>
<tr><td><code>.pos01</code></td><td><code>vec2</code><td>the position of the pixel, with (0, 0) being the bottom-left corner, and (+1, +1) being the top-right corner.</td></tr>
<tr><td><code>.time</code></td><td><code>float</code><td>the amount of time that has passed (wraps around every hour to prevent imprecision issues).</td></tr>
<tr><td><code>.mouse</code></td><td><code>vec2</code><td>the position of the mouse ranging from (−1, −1) to (+1, +1).</td></tr>
<tr><td><code>.mouse01</code></td><td><code>vec2</code><td>the position of the mouse ranging from (0, 0) to (+1, +1).</td></tr>
<tr><td><code>.pi</code></td><td><code>float</code><td>π (3.1415…).</td></tr>
<tr><td><code>.2pi</code></td><td><code>float</code><td>2π (6.2831…).</td></tr>
</tbody>
</table>