Ported some examples

This commit is contained in:
Devine Lu Linvega
2019-07-26 09:51:55 +09:00
parent 5a53fa58f2
commit 6f666c86dd
9 changed files with 30 additions and 53 deletions

View File

@@ -4,13 +4,11 @@
;
(def frame-middle
(div
(of
(frame) :h) 2))
frame-rect:h 2))
;
(def seg-width
(div
(of
(frame) :w) seg-count))
frame-rect:w seg-count))
;
(defn elevation
(i)
@@ -21,8 +19,7 @@
(time 0.001)
(div i 5)))
(div
(of
(frame) :h) 5)) frame-middle))
frame-rect:h 5)) frame-middle))
;
(defn draw-dash
(i)
@@ -40,8 +37,7 @@
(elevation i)) 4
(gradient
(line 50 0
(of
(frame) :w) 0)
frame-rect:w 0)
("#ffb545" "#72dec2")))))
;
(defn redraw

View File

@@ -4,15 +4,15 @@
(
(clear)
; vertical line
(stroke (line (of e :x) 0 (of e :x) (of e :y)) 2 "#ff0000")
(stroke (line e:x 0 e:x e:y) 2 "#ff0000")
; horizontal line
(stroke
(line 0 (of e :y) (of e :x) (of e :y)) 2 "#72dec2")
(line 0 (of e :y) e:x e:y) 2 "#72dec2")
; circle
(stroke
(circle
(of e :x)
(of e :y) 30) 2 "#ffffff")))
e:x
e:y 30) 2 "#ffffff")))
;
(on "mouse-down" redraw)
(on "mouse-up" redraw)