diff options
author | Colin Okay <colin@cicadas.surf> | 2022-06-27 15:06:12 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-06-27 15:06:12 -0500 |
commit | 2340c1a09895502667c9ba75c3db73b555ef40aa (patch) | |
tree | 2bdbacec7c5e10f90877eb0e1a3a038f631fd76f /examples | |
parent | 99cbc4aaecb3879fb11791a20ed9c5d7246f4cfe (diff) |
[modify] unit model-matrix [add] text model-matrix [add] scale funs
Diffstat (limited to 'examples')
-rw-r--r-- | examples/03-font-render.lisp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/examples/03-font-render.lisp b/examples/03-font-render.lisp index a854843..3a3d659 100644 --- a/examples/03-font-render.lisp +++ b/examples/03-font-render.lisp @@ -15,37 +15,45 @@ (ww::on-keydown () "Press any key to change the color of the text" (format t "Pressed a key, changing the color~%") - (setf (ww::text-color target) (random-text-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 + (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) -800)) - (incf (ww::unit-x target) 5))) + ;(incf (ww::unit-x target) 5) + )) (defmethod ww::boot ((app font-display)) (let ((hello (make-instance 'ww::text + ;:content "Yom" :content "Hell! Oh World..." :font (ww::get-asset "Ticketing.ttf" :asset-args '(:oversample 2))))) - (setf (ww::unit-width hello) - (* 5 (ww::unit-width hello)) - - (ww::unit-height hello) - (* 5 (ww::unit-height hello)) - - (ww::unit-x hello) 100 - - (ww::unit-y hello) 400) + + (ww::set-height-preserve-aspect hello 100) + (setf + (ww::unit-x hello) 100 + + (ww::unit-y hello) 400) + (ww::add-handler hello #'marquee) (ww::add-handler hello #'change-text-color) + (ww::add-handler hello (ww::on-mousedown () (format t "I Was Clicked at ~a,~a!~%" + x y))) (ww::refocus-on hello) - (ww::add-unit app hello))) + (describe hello) + + (ww::add-unit app hello) + )) (defun start () |