aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/03-font-render.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-30 07:35:16 -0500
committerColin Okay <colin@cicadas.surf>2022-06-30 07:35:16 -0500
commite0fc8f0f7a8b4756226cfb5e1c7581e411420228 (patch)
tree57213d8d2997e34d1ba674360b870d4223cd4908 /examples/03-font-render.lisp
parent56b743bbfe56823bfe482a4f4e579512041918d2 (diff)
[refactor] factored out affine from unit; made container a unit;
Diffstat (limited to 'examples/03-font-render.lisp')
-rw-r--r--examples/03-font-render.lisp18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/03-font-render.lisp b/examples/03-font-render.lisp
index 6f7d1a7..e36dc44 100644
--- a/examples/03-font-render.lisp
+++ b/examples/03-font-render.lisp
@@ -16,15 +16,15 @@
(format t "Pressed a key, changing the color~%")
(setf (ww::text-color target) (random-text-color))
- (with-accessors ((x ww::unit-x) (y ww::unit-y) (w ww::unit-width) (h ww::unit-height)) target
+ (with-accessors ((x ww::x) (y ww::y) (w ww::unit-width) (h ww::unit-height)) target
(format t "x:~a,y:~a,width:~a,height:~a~%" x y w h))))
(ww::defhandler marquee
(ww::on-perframe ()
- (when (< 900 (ww::unit-x target))
- (setf (ww::unit-x target)
+ (when (< 900 (ww::x target))
+ (setf (ww::x target)
-800))
- (incf (ww::unit-x target) 5 )))
+ (incf (ww::x target) 5 )))
(defvar *spin-table* (make-hash-table :synchronized t))
@@ -36,9 +36,9 @@
(setf
(gethash target *spin-table*) (+ rot 0.88)
(ww::text-color target) (random-text-color)
- (ww::unit-rotation target) rot)
+ (ww::rotation target) rot)
(progn
- (setf (ww::unit-rotation target) 0.0)
+ (setf (ww::rotation target) 0.0)
(ww::remove-handler target #'spin)
(remhash target *spin-table*))))))
@@ -61,8 +61,8 @@
(ww::scale-by hello 3.0)
(setf
- (ww::unit-x hello) (* 0.5 (- 800 (ww::unit-width hello)))
- (ww::unit-y hello) (* 0.5 (- 600 (ww::unit-height hello))))
+ (ww::x hello) (* 0.5 (- 800 (ww::unit-width hello)))
+ (ww::y hello) (* 0.5 (- 600 (ww::unit-height hello))))
(ww::add-handler hello #'marquee)
(ww::add-handler hello #'change-text-color)
(ww::add-handler hello #'twirl-on-click)
@@ -71,7 +71,7 @@
(ww::scale-by instructions 2.0)
(setf
- (ww::unit-x instructions) (* 0.5 (- 800 (ww::unit-width instructions))))
+ (ww::x instructions) (* 0.5 (- 800 (ww::unit-width instructions))))
(ww::add-unit app instructions)))