fairly accurate text positioning.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
[advent.actions :as actions]
|
||||
[advent.screens.dialogue :as dialogue])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion] ))
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]))
|
||||
|
||||
(defn jump-to [screen entities entity [x y]]
|
||||
(let [scale-fn (-> entities :background :scale-fn)
|
||||
@@ -58,9 +58,14 @@
|
||||
|
||||
(defn talk [target-id text]
|
||||
(fn [screen entities]
|
||||
(run! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) 35)
|
||||
:target-id target-id)
|
||||
(-> entities
|
||||
(update-in [target-id :actions] rest)
|
||||
(assoc-in [target-id :anim] (get-in entities [target-id :talk])))))
|
||||
(let [target-y (get-in entities [target-id :y])
|
||||
scale-fn (get-in entities [:background :scale-fn])
|
||||
scale (scale-fn target-y)
|
||||
height (* scale 36)]
|
||||
(run! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) height)
|
||||
:target-id target-id
|
||||
:scale scale)
|
||||
(-> entities
|
||||
(update-in [target-id :actions] rest)
|
||||
(assoc-in [target-id :anim] (get-in entities [target-id :talk]))))))
|
||||
|
||||
Reference in New Issue
Block a user