From 37a466f7089b88f5554eafbe9b4bcee7290868c7 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 7 Apr 2021 17:04:39 -0400 Subject: graphics: Rewrite 9-patch implementation and move it to its own module. --- examples/9-patch.scm | 17 +++++++++++++++++ examples/nine-patch.scm | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 examples/9-patch.scm delete mode 100644 examples/nine-patch.scm (limited to 'examples') diff --git a/examples/9-patch.scm b/examples/9-patch.scm new file mode 100644 index 0000000..451f079 --- /dev/null +++ b/examples/9-patch.scm @@ -0,0 +1,17 @@ +(use-modules (chickadee) + (chickadee math rect) + (chickadee math vector) + (chickadee graphics font) + (chickadee graphics 9-patch) + (chickadee graphics texture)) + +(define image #f) + +(define (load) + (set! image (load-image "images/dialog-box.png"))) + +(define (draw alpha) + (draw-9-patch image (make-rect 192.0 192.0 256.0 96.0) #:margin 4.0) + (draw-text "I am error." #v(200.0 266.0))) + +(run-game #:load load #:draw draw) diff --git a/examples/nine-patch.scm b/examples/nine-patch.scm deleted file mode 100644 index d8988c8..0000000 --- a/examples/nine-patch.scm +++ /dev/null @@ -1,17 +0,0 @@ -(use-modules (chickadee) - (chickadee math rect) - (chickadee math vector) - (chickadee graphics font) - (chickadee graphics sprite) - (chickadee graphics texture)) - -(define image #f) - -(define (load) - (set! image (load-image "images/dialog-box.png"))) - -(define (draw alpha) - (draw-nine-patch image (make-rect 192.0 192.0 256.0 96.0) #:margin 6) - (draw-text "I am error." #v(200.0 266.0))) - -(run-game #:load load #:draw draw) -- cgit v1.2.3