From 25fde7edc3722e219fe37406cd9653e8c7792df0 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Sat, 1 Nov 2014 14:02:54 -0700 Subject: [PATCH] text positioning is fixed. --- desktop/src-common/advent/screens/dialogue.clj | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/desktop/src-common/advent/screens/dialogue.clj b/desktop/src-common/advent/screens/dialogue.clj index c1a99801..ef03a484 100644 --- a/desktop/src-common/advent/screens/dialogue.clj +++ b/desktop/src-common/advent/screens/dialogue.clj @@ -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]]