aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/05-frameset-animation.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-07-01 09:47:16 -0500
committerColin Okay <colin@cicadas.surf>2022-07-01 09:47:16 -0500
commit867703d82c6e8b7a2b424845fcb30537061de45a (patch)
tree1f3180042222e819a91dcc3c8aa2810bc69efc2c /examples/05-frameset-animation.lisp
parentf93d073f8cd06fbccb1285ae04c8b9d2d5c5a7b0 (diff)
[add] frameset class and an [exmaple] using it
Diffstat (limited to 'examples/05-frameset-animation.lisp')
-rw-r--r--examples/05-frameset-animation.lisp41
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/05-frameset-animation.lisp b/examples/05-frameset-animation.lisp
new file mode 100644
index 0000000..4686ecc
--- /dev/null
+++ b/examples/05-frameset-animation.lisp
@@ -0,0 +1,41 @@
+;;;; examples/05-frameset-animation.lisp
+
+(defpackage #:ww.examples/5
+ (:use #:cl))
+
+(in-package #:ww.examples/5)
+
+(defclass frameset-example (ww::application) ())
+
+(ww::defhandler toggle-on-click
+ (ww::on-mousedown ()
+ (setf (ww::runningp target)
+ (not (ww::runningp target)))))
+
+(defmethod ww::boot ((app frameset-example))
+ (let ((fs
+ (ww::make-frameset
+ '("dude/Front_Stand.png"
+ "dude/Front_Left.png"
+ "dude/Front_Stand.png"
+ "dude/Front_Right.png")
+ :fps 3)))
+
+ (setf (ww::x fs) 380
+ (ww::y fs) 200)
+
+ (ww::add-handler fs #'toggle-on-click)
+
+ (ww::add-unit app fs)))
+
+
+(defun start ()
+ (ww::start (make-instance
+ 'frameset-example
+ :fps 30
+ :width 800
+ :height 600
+ :title "Wheelwork Example: An Animated Sprite"
+ :asset-root (merge-pathnames
+ "examples/"
+ (asdf:system-source-directory :wheelwork)))))