fixing a number of issues.

This commit is contained in:
Bryce Covert
2016-12-21 08:21:44 -08:00
parent 2e50dbf636
commit b7690a97c0
3 changed files with 75 additions and 55 deletions

View File

@@ -61,7 +61,11 @@
tr (bitmap-font! font :get-region)
scale (* scale (/ utils/ui-scale 2))
scale (or (min (max scale (/ utils/ui-scale 5) 0.4) (/ utils/ui-scale 4)) (/ utils/ui-scale 4))
scale (or (min
(max scale
(/ utils/ui-scale 5) 0.4)
(/ utils/ui-scale 4))
(/ utils/ui-scale 4))
_ (.setFilter (.getTexture tr) Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
style (style :label font color)
[source-x source-y] [x y]
@@ -182,7 +186,7 @@
(assoc-in [:state :labels] labels)
(assoc-in [:state :table]
(doto (-> labels
(vertical :align Align/bottomLeft :pad 20 :space 24)
(vertical :align Align/bottomLeft :pad (* utils/ui-scale 20) :space (* utils/ui-scale 24))
(#(utils/add-actor-to-stage screen %))
(assoc :x 0 :y 0 :width 1240)
@@ -269,9 +273,10 @@
tr (bitmap-font! font :get-region)
_ (.setFilter (.getTexture tr) Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
style (doto (style :label font (color :white))
(#(-> % .font .getData (.setScale (* utils/ui-scale 0.25)))))]
(#(-> % .font .getData (.setScale (/ utils/ui-scale 4)))))]
{:label (as-> (label "" style) l
(do (label! l :set-alignment (if utils/mobile? Align/bottomLeft Align/center))
(label! l :set-font-scale (* utils/ui-scale 0.25))
l)
(assoc l :x 0 :y 0 :baseline 10000)
(utils/add-actor-to-stage screen l))
@@ -295,7 +300,7 @@
(cond-> entities
true (assoc-in [:label :text] hover-text)
utils/mobile? (update-in [:label] assoc :x (* 20 4) :y 12)
utils/mobile? (update-in [:label] assoc :x (* 20 4 utils/ui-scale) :y 12)
(and utils/mobile? (or item-cursor action-cursor)
(= :main action-cursor))
@@ -307,7 +312,7 @@
(assoc
(texture (aget all-icons 0 (.indexOf utils/+all-cursors+ (or item-cursor action-cursor))))
:x 4 :y 4
:width (* 18 4) :height (* 16 4)))
:width (* 18 4 utils/ui-scale) :height (* 16 4 utils/ui-scale)))
(not utils/mobile?) (update-in [:label] assoc :x scene-x :y scene-y)