summaryrefslogtreecommitdiff
path: root/examples/grid.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-12-13 17:52:15 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-12-13 20:53:29 -0500
commitfe89f847503573378180ddbe5e6badec18093c37 (patch)
tree33ef04eefee4b6c9da2dc3cb72629e9963dd7dad /examples/grid.scm
parentda895821c9aa1f8ec63e2eb7e8d317040d9989d7 (diff)
render: font: Include a default font for convenience.
* data/fonts/good-neighbors.fnt: New file. * data/fonts/good-neighbors.png: New file. * data/CREDITS: New file. * examples/fonts/AUTHORS: Delete. * examples/fonts/good_neighbors_starling.png: Delete. * examples/fonts/good_neighbors_starling.xml: Delete. * Makefile.am (dist_pkgdata_DATA, fontsdir, dist_fonts_DATA): New variables. (EXTRA_DIST): Remove examples/fonts files. * chickadee/render/font.scm (draw-text): Make font an optional keyword argument. * doc/api.texi (Fonts): Document it. * examples/grid.scm: Update to use new draw-text API. * examples/nine-patch.scm: Ditto. * examples/text.scm: Ditto. squash! render: font: Include a default font for convenience.
Diffstat (limited to 'examples/grid.scm')
-rw-r--r--examples/grid.scm4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/grid.scm b/examples/grid.scm
index 39ad50e..6fab47a 100644
--- a/examples/grid.scm
+++ b/examples/grid.scm
@@ -10,7 +10,6 @@
(chickadee sdl)
(sdl2 input keyboard))
-(define font #f)
(define grid (make-grid))
(define item-color (make-color 0.7 0.0 0.0 0.5))
(define cell-color (make-color 0.0 0.7 0.0 0.2))
@@ -20,7 +19,6 @@
(define player-velocity #v(0.0 0.0))
(define (load)
- (set! font (load-font "fonts/good_neighbors_starling.xml"))
(grid-add grid 'wall-left 0 0 32 480)
(grid-add grid 'wall-top 32 448 576 32)
(grid-add grid 'wall-right 608 0 32 480)
@@ -75,7 +73,7 @@
(for-each-cell (lambda (cell x y)
(set-vec2-x! %cell-count-pos (+ (* x size) (/ size 2)))
(set-vec2-y! %cell-count-pos (+ (* y size) (/ size 2)))
- (draw-text font (number->string* (cell-count cell))
+ (draw-text (number->string* (cell-count cell))
%cell-count-pos))
grid)))
(for-each-item (lambda (item rect)