summaryrefslogtreecommitdiff
path: root/examples/nine-patch.scm
blob: 28522454ace811ebb0614695d595853798c43cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(use-modules (chickadee)
             (chickadee math rect)
             (chickadee math vector)
             (chickadee render font)
             (chickadee render sprite)
             (chickadee render texture))

(define image #f)
(define font #f)

(define (load)
  (set! image (load-image "images/dialog-box.png"))
  (set! font (load-font "fonts/good_neighbors_starling.xml")))

(define (draw alpha)
  (draw-nine-patch image (make-rect 192.0 192.0 256.0 96.0) #:margin 6)
  (draw-text font "I am error." #v(200.0 266.0)))

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