From 3c4d1d23a9458777f05c52fc1dae92f6467ac466 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 18 Aug 2013 09:23:24 -0400 Subject: Update font example. --- examples/font.scm | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/examples/font.scm b/examples/font.scm index 79a7743..8cdfd3a 100644 --- a/examples/font.scm +++ b/examples/font.scm @@ -1,4 +1,5 @@ -(use-modules (2d color) +(use-modules (figl gl) + (2d color) (2d game-loop) (2d window) (2d helpers) @@ -8,6 +9,7 @@ (define window-height 600) (define font (load-font "fonts/Boxy-Bold.ttf" 48)) (define text "The quick brown fox jumped over the lazy dog.") +(define textbox (make-textbox font text #(320 300) white 'left 200)) ;; Open the window. (open-window window-width window-height) @@ -23,18 +25,10 @@ ;; Draw our sprite (define (render) (let ((fps (floor (inexact->exact (current-fps))))) - (render-font font - (format #f "FPS: ~d" fps) - 0 - 0 - white - #f)) - (render-font font - "Hello, world!" - 320 - 300 - green - #f)) + (with-gl-push-matrix + (apply-color white) + (draw-font font (format #f "FPS: ~d" fps)))) + (draw-textbox textbox)) ;; Register callbacks. (add-hook! on-quit-hook (lambda () (quit-demo))) -- cgit v1.2.3