diff --git a/desktop/sources/scripts/surface.js b/desktop/sources/scripts/surface.js index d97b2c5..ff7a017 100644 --- a/desktop/sources/scripts/surface.js +++ b/desktop/sources/scripts/surface.js @@ -37,7 +37,7 @@ function Surface (ronin) { if (isText(shape)) { context.textAlign = shape.a context.font = `${shape.p}px ${shape.f}` - context.strokeText(shape.t, shape.x, shape.y) + context.strokeText(`${shape.t}`, shape.x, shape.y) } else if (isSvg(shape)) { context.lineWidth = width context.save() @@ -59,7 +59,7 @@ function Surface (ronin) { if (isText(shape)) { context.textAlign = shape.a context.font = `${shape.p}px ${shape.f}` - context.fillText(shape.t, shape.x, shape.y) + context.fillText(`${shape.t}`, shape.x, shape.y) } else if (isSvg(shape)) { context.save() context.translate(shape.x, shape.y) diff --git a/examples/archives/arrays.lisp b/examples/_OLD/arrays.lisp similarity index 100% rename from examples/archives/arrays.lisp rename to examples/_OLD/arrays.lisp diff --git a/examples/archives/import.lisp b/examples/_OLD/import.lisp similarity index 100% rename from examples/archives/import.lisp rename to examples/_OLD/import.lisp diff --git a/examples/archives/include.lisp b/examples/_OLD/include.lisp similarity index 100% rename from examples/archives/include.lisp rename to examples/_OLD/include.lisp diff --git a/examples/archives/objects.lisp b/examples/_OLD/objects.lisp similarity index 100% rename from examples/archives/objects.lisp rename to examples/_OLD/objects.lisp diff --git a/examples/archives/random.file.lisp b/examples/_OLD/random.file.lisp similarity index 100% rename from examples/archives/random.file.lisp rename to examples/_OLD/random.file.lisp diff --git a/examples/archives/resize.lisp b/examples/_OLD/resize.lisp similarity index 100% rename from examples/archives/resize.lisp rename to examples/_OLD/resize.lisp diff --git a/examples/basics/basics.lisp b/examples/basics/basics.lisp deleted file mode 100644 index cbffb3e..0000000 --- a/examples/basics/basics.lisp +++ /dev/null @@ -1,13 +0,0 @@ -; basics - -; define a variable -(def a 25) -(echo a) - -; define a function -(defn add-two (a) (add 2 a)) -(echo (add-two 4)) - -; use a lambda -(times 5 - (λ (a) (echo (concat "time:" a)))) \ No newline at end of file diff --git a/examples/benchmark/general.lisp b/examples/basics/benchmark.lisp similarity index 100% rename from examples/benchmark/general.lisp rename to examples/basics/benchmark.lisp diff --git a/examples/basics/shapes.lisp b/examples/basics/shapes.lisp index 4ad9287..71b6d57 100644 --- a/examples/basics/shapes.lisp +++ b/examples/basics/shapes.lisp @@ -1,26 +1,35 @@ -; Shapes (clear) - -; variables -(def center-w (div frame-rect:w 2)) -(def center-h (div frame-rect:h 2)) -(def rad (div frame-rect:h 4)) - -; draw circle +; stroke rect (stroke - (circle center-w center-h rad) "white" 2) - -; draw rect + (rect 0 0 300 300) "red") (stroke - (rect - (sub center-w rad) (sub center-h rad) center-h center-h) "white" 2) - -; draw line + (circle 150 150 150) "white") (stroke - (line (sub center-w rad) center-h (add center-w rad) center-h)) -(stroke (text 10 170 200 "HELL") "pink" 2) - -; draw ellipse + (ellipse 150 150 75 150) "red") (stroke - (ellipse center-w center-h rad (div rad 2)) "white" 2) + (line 0 150 300 150) "red") +(stroke + (text 600 300 60 "hell") "white") +(stroke + (poly + (pos 300 300) + (pos 600 0) + (pos 600 300)) "red") +(move 0 300) +(fill + (rect 0 0 300 300) "red") +(fill + (circle 150 150 150) "white") +(fill + (ellipse 150 150 75 150) "red") +(fill + (line 0 150 300 150) "red") +(fill + (text 600 300 60 "hell") "white") +(fill + (poly + (pos 300 300) + (pos 600 0) + (pos 600 300)) "red") +(resetTransform) \ No newline at end of file