supporting different dialogue colors.

This commit is contained in:
2014-12-16 11:28:20 -08:00
parent 654f564311
commit 6a8191f49a
7 changed files with 9 additions and 5 deletions

View File

@@ -33,15 +33,14 @@
entities)
:on-talk
(fn [{:keys [create-talk target-id text x y scale]} [entities]]
(fn [{:keys [create-talk target-id color text x y scale]} [entities]]
(let [font (bitmap-font "ego/font.fnt" )
_ (bitmap-font! font :set-markup-enabled true)
tr (bitmap-font! font :get-region)
scale (or (min (max scale 0.75) 1) 1)
tx (.getTexture tr)
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
talk (assoc (label text (style :label font (if (= :ego target-id)
(color :white)
(color :yellow)))) :y (* 4 y))]
talk (assoc (label text (style :label font color)) :y (* 4 y))]
(label! talk :set-font-scale scale)
(label! talk :set-alignment Align/center)
(assoc entities target-id (-> talk