aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-30 10:32:18 -0500
committerColin Okay <colin@cicadas.surf>2022-06-30 10:32:18 -0500
commit2c1cb6075ea5cf3544491a89a544d2dfc6071567 (patch)
tree5e9a2dc188277964cfbd1c99db297fda64b99127 /examples
parent749a5a306deacd5c481ecc4c53b7f03178c3e335 (diff)
[add] text button example; button file to asd file
Diffstat (limited to 'examples')
-rw-r--r--examples/04-a-button.lisp23
1 files changed, 16 insertions, 7 deletions
diff --git a/examples/04-a-button.lisp b/examples/04-a-button.lisp
index 85d2e83..be2ec24 100644
--- a/examples/04-a-button.lisp
+++ b/examples/04-a-button.lisp
@@ -9,16 +9,25 @@
(defclass app-with-buttons (ww::application) ())
(defmethod ww::boot ((app app-with-buttons))
- (let ((b
- (ww::make-texture-button
- "Fezghoul.png" "GelatinousCube.png"
- :pressed (lambda (button) (format t "Button ~a was clicked!~%" button))
- :released (lambda (button) (format t "Button ~a was relased!~%" button )))))
+ (let* ((b
+ (ww::make-texture-button
+ "Fezghoul.png" "GelatinousCube.png"
+ :pressed (lambda (button) (format t "Button ~a was clicked!~%" button))
+ :released (lambda (button) (format t "Button ~a was relased!~%" button))))
+ (font
+ (ww::get-asset "Ticketing.ttf"))
+ (b2
+ (ww::make-text-button font "Press Me" "Relase Me")))
(setf (ww::x b) 100
- (ww::y b) 100)
+ (ww::y b) 100
+ (ww::x b2) 400
+ (ww::y b2) 100)
+
(ww::scale-by b 4.0)
-
+ (ww::scale-by b2 3)
+
+ (ww::add-unit app b2)
(ww::add-unit app b)))
(defun start ()