diff options
author | Colin Okay <colin@cicadas.surf> | 2022-06-27 15:23:35 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-06-27 15:23:35 -0500 |
commit | e5104cf39570605859c3648ed83c37fe647b0e3f (patch) | |
tree | cb59f1b5d0f0ae9f354982ecfab7e3cf09e9570f /examples | |
parent | 2340c1a09895502667c9ba75c3db73b555ef40aa (diff) |
[example] 1 2 and 3 find the right asset root automatically
Diffstat (limited to 'examples')
-rw-r--r-- | examples/01-bitmap-display.lisp | 8 | ||||
-rw-r--r-- | examples/02-moving-bitmp.lisp | 4 | ||||
-rw-r--r-- | examples/03-font-render.lisp | 11 |
3 files changed, 15 insertions, 8 deletions
diff --git a/examples/01-bitmap-display.lisp b/examples/01-bitmap-display.lisp index 788ae6d..c9e0275 100644 --- a/examples/01-bitmap-display.lisp +++ b/examples/01-bitmap-display.lisp @@ -19,5 +19,9 @@ (defun start () - (ww::start (make-instance 'bitmap-display - :asset-root #P"~/projects/wheelwork/examples/"))) + (ww::start + (make-instance + 'bitmap-display + :asset-root (merge-pathnames + "examples/" + (asdf:system-source-directory :wheelwork))))) diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp index 53a4f35..e656367 100644 --- a/examples/02-moving-bitmp.lisp +++ b/examples/02-moving-bitmp.lisp @@ -114,7 +114,9 @@ (ww::start (make-instance 'bitmap-display :scale 2.0 :fps 30 - :asset-root #P"~/projects/wheelwork/examples/"))) + :asset-root (merge-pathnames + "examples/" + (asdf:system-source-directory :wheelwork))))) diff --git a/examples/03-font-render.lisp b/examples/03-font-render.lisp index 3a3d659..fb43b08 100644 --- a/examples/03-font-render.lisp +++ b/examples/03-font-render.lisp @@ -1,6 +1,7 @@ (defpackage #:ww.examples/3 - (:use :cl)) + (:use #:cl) + (:export #:start)) (in-package #:ww.examples/3) @@ -25,14 +26,12 @@ (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))))) @@ -61,7 +60,9 @@ :fps 60 :refocus-on-mousedown-p nil :title "Wheelwork Example: Font display" - :asset-root "~/projects/wheelwork/examples/") + :asset-root (merge-pathnames + "examples/" + (asdf:system-source-directory :wheelwork))) :x 2380)) |