summaryrefslogtreecommitdiff
path: root/examples/font.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-01-10 07:45:41 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-01-10 07:45:41 -0500
commit5523027f6369e9ec3f990144e8ef2cd4f243476e (patch)
treedf91f447da824dd5e15f0d86aae9e5ec3d4f0409 /examples/font.scm
parent6bdd1e305834dcc9be22d9a54d84f025a24d4825 (diff)
Update some of the example programs to use the new API.
* 2d/examples/common.scm: New file. * 2d/examples/coroutine.scm: Updated. * 2d/examples/font.scm: Updated. * 2d/examples/simple.scm: Updated. * 2d/examples/tilemap.scm: Updated.
Diffstat (limited to 'examples/font.scm')
-rw-r--r--examples/font.scm23
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))