diff options
Diffstat (limited to 'examples/font.scm')
-rw-r--r-- | examples/font.scm | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/examples/font.scm b/examples/font.scm index 05eb4bf..465600c 100644 --- a/examples/font.scm +++ b/examples/font.scm @@ -3,11 +3,12 @@ (2d color) (2d font) (2d game) - (2d scene) - (2d stage) - (2d vector2)) + (2d vector2) + (2d window)) -(define (make-demo-textbox) +(load "common.scm") + +(define textbox (make-textbox (load-font "fonts/Boxy-Bold.ttf" 48) "The quick brown fox jumped over the lazy dog." (vector2 240 160) @@ -15,15 +16,7 @@ 'left 200)) -(define fonts-scene - (make-scene - "Fonts" - #:init make-demo-textbox - #:draw draw-textbox)) - -(define fonts-demo - (make-game - #:title "Fonts" - #:first-scene fonts-scene)) +(add-hook! draw-hook (lambda (dt alpha) (draw-textbox textbox))) -(run-game fonts-demo) +(with-window (make-window #:title "Fonts") + (run-game-loop)) |