supporting different dialogue colors.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user