summaryrefslogtreecommitdiff
path: root/examples/font.scm
blob: 3c8e0853e89d09d6b72de670a2402f4a2839abbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(use-modules (srfi srfi-9)
             (figl gl)
             (2d color)
             (2d font)
             (2d game)
             (2d game-loop)
             (2d scene)
             (2d stage)
             (2d vector2))

(define (make-demo-textbox)
  (make-textbox (load-font "fonts/Boxy-Bold.ttf" 48)
                "The quick brown fox jumped over the lazy dog."
                (vector2 240 160)
                white
                '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))

(run-game fonts-demo)