text positioning is fixed.
This commit is contained in:
@@ -37,16 +37,14 @@
|
||||
(let [font (bitmap-font "ego/font.fnt" )
|
||||
tr (bitmap-font! font :get-region)
|
||||
scale (or (min (max scale 0.75) 1) 1)
|
||||
width (/ (game :width) 1.5)
|
||||
tx (.getTexture tr)
|
||||
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
|
||||
talk (assoc (label text (style :label font (color :white))) :x (- (* 4 x) (/ width 2)) :y (* 4 y))
|
||||
talk (ensure-on-screen talk)]
|
||||
(label! talk :set-wrap true)
|
||||
(label! talk :set-width width)
|
||||
talk (assoc (label text (style :label font (color :white))) :y (* 4 y))]
|
||||
(label! talk :set-font-scale scale)
|
||||
(label! talk :set-alignment Align/center)
|
||||
(assoc entities target-id talk)))
|
||||
(assoc entities target-id (-> talk
|
||||
(assoc :x (- (* 4 x) (/ (label! talk :get-width) 2)))
|
||||
ensure-on-screen ))))
|
||||
|
||||
:stop-talk
|
||||
(fn [{:keys [target-id] } [entities]]
|
||||
|
||||
Reference in New Issue
Block a user