diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-12-13 17:52:15 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-12-13 20:53:29 -0500 |
commit | fe89f847503573378180ddbe5e6badec18093c37 (patch) | |
tree | 33ef04eefee4b6c9da2dc3cb72629e9963dd7dad /examples/text.scm | |
parent | da895821c9aa1f8ec63e2eb7e8d317040d9989d7 (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/text.scm')
-rw-r--r-- | examples/text.scm | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/examples/text.scm b/examples/text.scm index 0903a90..40b7653 100644 --- a/examples/text.scm +++ b/examples/text.scm @@ -3,21 +3,12 @@ (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))" + (draw-text "(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." + (draw-text "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" + (draw-text "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) +(run-game/sdl #:draw draw) |