summaryrefslogtreecommitdiff
path: root/examples/text.scm
blob: 0903a9085f58ab2e9ac7ab8ac5dcc9e219815a30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(use-modules (chickadee)
             (chickadee math vector)
             (chickadee render font)
             (chickadee sdl))

(define font #f)

(define (load)
  (set! font (load-font "fonts/good_neighbors_starling.xml")))

(define (draw alpha)
  (draw-text font "(draw-text font \"Hello, world!\" (vec2 100.0 200.0))"
             #v(100.0 200.0))
  (draw-text font "Chickadee is a game development toolkit for Guile Scheme."
             #v(100.0 150.0))
  (draw-text font "The quick brown fox jumps over the lazy dog"
             #v(100.0 100.0)))

(define (key-press key scan modifiers repeat?)
  (when (eq? key 'q)
    (abort-game)))

(run-game/sdl #:load load #:draw draw #:key-press key-press)