summaryrefslogtreecommitdiff
path: root/examples/font.scm
blob: 05eb4bf94b231cb649fc8f5f7b9bc6aa49c31f3b (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
(use-modules (srfi srfi-9)
             (figl gl)
             (2d color)
             (2d font)
             (2d game)
             (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)