diff --git a/desktop/src-common/advent/screens/dialogue.clj b/desktop/src-common/advent/screens/dialogue.clj index 524de336..748699be 100644 --- a/desktop/src-common/advent/screens/dialogue.clj +++ b/desktop/src-common/advent/screens/dialogue.clj @@ -16,9 +16,9 @@ [com.badlogic.gdx Screen])) (defn ensure-on-screen [talk] - (let [margin-width (* 0.05 (game :width)) + (let [margin-width (* 0.05 1280) minimum-x margin-width - maximum-x (- (game :width) margin-width) + maximum-x (- 1280 margin-width) label-width (label! talk :get-width) label-right (+ (:x talk) label-width) talk (cond (> label-right maximum-x) (assoc talk :x (- maximum-x label-width)) @@ -78,7 +78,7 @@ (let [[x y] (scene-world->talk-world scene-viewport [(:source-x dialogue) (:source-y dialogue)])] (-> entities - (assoc-in [:dialogue :x] (- x (/ (label! dialogue :get-width) 2))) + (assoc-in [:dialogue :x] (- x (/ (doto (label! dialogue :get-width) println) 2))) (assoc-in [:dialogue :y] y) (update-in [:dialogue] ensure-on-screen) ))))