diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-11-19 21:47:33 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-11-19 22:03:16 +0000 |
| commit | 2501025108394d875a6e5f70686333799d27ffc8 (patch) | |
| tree | 0a5a7c06f94cad07731aa261622b9588f8e7e121 /examples/axis_lock.moon | |
| parent | a touch of color (diff) | |
| download | watch-cad-2501025108394d875a6e5f70686333799d27ffc8.tar.gz watch-cad-2501025108394d875a6e5f70686333799d27ffc8.zip | |
more examples
Diffstat (limited to 'examples/axis_lock.moon')
| -rw-r--r-- | examples/axis_lock.moon | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/axis_lock.moon b/examples/axis_lock.moon new file mode 100644 index 0000000..91a85fd --- /dev/null +++ b/examples/axis_lock.moon @@ -0,0 +1,17 @@ +import vec2 from require 'cpml' + +=> + -- draw helper lines + origin = vec2 200, 600 + draw.line origin, vec2 200, 0 + draw.line origin, vec2 1000, 600 + + -- input two points + input.line @l, { x: 200 }, { y: 600 } + + -- restrict to first quadrant + if @l!.frm.y > 600 + @l!.frm.y = 600 + + if @l!.to.x < 200 + @l!.to.x = 200 |
