From 5523027f6369e9ec3f990144e8ef2cd4f243476e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 10 Jan 2014 07:45:41 -0500 Subject: 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. --- examples/font.scm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'examples/font.scm') 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)) -- cgit v1.2.3