summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-07-24 23:02:45 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-07-27 17:15:47 +0200
commit5837c04a436a64ff75aa5acdbf04a5dc85cbb604 (patch)
tree0e604699d19e0659817b0d185ff366da5797b1d7 /scenes
parent61e01fd86d2e1a8e50a1f3609be6b02cd127e79e (diff)
Use more readable font.
Diffstat (limited to 'scenes')
-rw-r--r--scenes/game.scm16
1 files changed, 10 insertions, 6 deletions
diff --git a/scenes/game.scm b/scenes/game.scm
index fbe32be..efaafe4 100644
--- a/scenes/game.scm
+++ b/scenes/game.scm
@@ -65,6 +65,9 @@
(load-tile-font "assets/fonts/bubblemad_8x8.png" 8 8
" !\"©_%❤'()*+,-./0123456789:←<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))
+(define-asset talk-font
+ (load-font "assets/fonts/good_neighbors_starling.xml"))
+
(define (start-position game name)
"Look up the start position for an object with the given NAME in the
map's object layer."
@@ -158,8 +161,8 @@ map's object layer."
(attach bubble
(make <filled-rect>
#:name 'dialog-selection-indicator
- #:region (make-rect 0.0 0.0 10 10)
- #:position (vec2 0 40)
+ #:region (make-rect 0.0 0.0 5 10)
+ #:position (vec2 0 65)
#:color region)))
(+ lines
(render-text bubble text
@@ -325,17 +328,18 @@ be executed; if so, perform the action."
(define* (render-text bubble text #:key (y-offset 0) (suffix '-text))
"Fill the bubble with lines of text. Return the number of lines."
- (let ((lines (arrange-text text)))
+ (let ((lines (arrange-text text (asset-ref talk-font)
+ #:margin 4.0)))
(for-each (lambda (line i)
(attach bubble (make <label>
#:name (symbol-append 'dialog-line-
(string->symbol
(number->string i))
suffix)
- #:font game-font
+ #:font talk-font
#:text line
#:position (vec2 4.0
- (- 40 y-offset (* %line-height i))))))
+ (- 65 y-offset (* %line-height i))))))
lines
(iota (length lines)))
(length lines)))
@@ -408,7 +412,7 @@ be executed; if so, perform the action."
#:children
(list (make <filled-rect>
#:name 'text-bubble-box
- #:region (make-rect 0.0 0.0 %width 50)
+ #:region (make-rect 0.0 0.0 %width 80)
#:position (vec2 0 0)
#:rank -10 ; background
#:color (make-color 0 0 0 0.5))))))))