From 95abe4b1dc0dbd8b09a077585301f97488f1c5e8 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 2 Aug 2019 20:33:19 +0900 Subject: [PATCH] Added transforms example --- examples/basics/shapes.lisp | 6 +++--- examples/basics/transforms.lisp | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 examples/basics/transforms.lisp diff --git a/examples/basics/shapes.lisp b/examples/basics/shapes.lisp index c80fa98..adecf1a 100644 --- a/examples/basics/shapes.lisp +++ b/examples/basics/shapes.lisp @@ -1,5 +1,5 @@ +; shapes (clear) -; stroke rect (stroke (rect 0 0 300 300) "red") (stroke @@ -19,7 +19,7 @@ (pos 300 300) (pos 600 0) (pos 600 300)) "red") -(move 0 300) +(transform:move 0 300) (fill (rect 0 0 300 300) "red") (fill @@ -39,4 +39,4 @@ (pos 300 300) (pos 600 0) (pos 600 300)) "red") -(resetTransform) \ No newline at end of file +(transform:reset) diff --git a/examples/basics/transforms.lisp b/examples/basics/transforms.lisp new file mode 100644 index 0000000..a83c1b1 --- /dev/null +++ b/examples/basics/transforms.lisp @@ -0,0 +1,21 @@ +; transforms +(clear) +(def f + (frame)) +(transform:move 150 150) +(fill + (circle 0 0 150) "#ffb545") +(transform:move 300 0) +(transform:rotate + (rad 90)) +(fill + (circle 0 0 150) "white") +(transform:move 300 0) +(transform:rotate + (rad 90)) +(fill + (circle 0 0 150) "#72dec2") +(transform:move 300 0) +(fill + (circle 0 0 150) "#555") +(transform:reset) \ No newline at end of file