Fixes in lambda/function definitions (body args). Cleanup of examples and decumentation. Added convenience methods for JS interop, lists and objects.

This commit is contained in:
Kuba Antosik
2021-04-04 18:35:26 +10:00
parent 8d23e5264e
commit 0cebbe52cb
24 changed files with 655 additions and 120 deletions

View File

@@ -35,9 +35,9 @@
;
(defn redraw ()
(
(clear)
(rec 300)))
(rec 300))
;
(on "animate" redraw)

View File

@@ -3,6 +3,9 @@
;
(clear)
(def frame
(get-frame))
;
(def gradient-line
(line frame:c 0 frame:c frame:h))

View File

@@ -2,6 +2,9 @@
(clear)
(def frame
(get-frame))
; times
@@ -26,13 +29,13 @@
; position on a circle from angle
(defn circle-pos
(cx cy r a) {:x
(cx cy r a) (object "x"
(add cx
(mul r
(cos a))) :y
(cos a))) "y"
(add cy
(mul r
(sin a)))})
(sin a)))))
; draw
@@ -42,10 +45,10 @@
(
(stroke
(line cx cy
(:x
(circle-pos cx cy r a))
(:y
(circle-pos cx cy r a))) "white" 2)))
(get
(circle-pos cx cy r a) "x")
(get
(circle-pos cx cy r a) "y")) "white" 2)))
;
(defn draw-star

View File

@@ -2,7 +2,8 @@
(def theme
(get-theme))
(def frame
(get-frame))
; ex: theme:f_high

View File

@@ -1,5 +1,11 @@
(clear)
(def theme
(get-theme))
(def frame
(get-frame))
(defn branch
(v)
(if

View File

@@ -2,6 +2,9 @@
(clear)
(def theme
(get-theme))
(transform:move 150 150)
(fill