normal mode still styled correctly.

This commit is contained in:
Bryce Covert
2017-01-08 17:23:53 -08:00
parent d6b3fd805c
commit b2690c5a73
4 changed files with 20 additions and 9 deletions

View File

@@ -1309,9 +1309,18 @@ void main ()
:on-key-up
(fn [screen entities options]
(when (= (key-code :escape) (:key options))
(utils/toggle-fullscreen!))
nil)
(cond
(= (key-code :escape) (:key options))
(utils/toggle-fullscreen!)
(and utils/mobile?
(= (key-code :m) (:key options)))
(-> entities
(remove-cam-tweens)
(assoc-in [:cam :zoom] utils/max-zoom #_(max utils/max-zoom (min utils/min-zoom (* (or start-zoom zoom) (/ initial-distance distance))))))
:else
nil))
:on-pan
(fn [screen entities {:keys [input-x input-y delta-x delta-y]}]

View File

@@ -134,7 +134,7 @@
(defn button-style []
(let [^TextButton$TextButtonStyle style (skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle)
tx (-> style .font .getRegion .getTexture)]
(-> style .font .getData (.setScale 1.0))
(-> style .font .getData (.setScale utils/button-font-scale))
(call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
style))
@@ -161,7 +161,7 @@
(defn make-checkbox
([msg checked & rest]
(let [s (skin! (skin "ui/ui.json") :get CheckBox$CheckBoxStyle)]
(-> s .font .getData (.setScale 0.5))
(-> s .font .getData (.setScale utils/title-label-scale))
(doto (merge (check-box msg s)
(apply hash-map rest))
(set-checkbox-state checked)
@@ -178,7 +178,7 @@
bg (drawable :nine-patch ^NinePatch (:object p))
style (style :label font (or col (color 1.0 0.3 0.3 1.0)))
#_#__ (set! (.background style) bg)]
(-> style .font .getData (.setScale 0.5))
(-> style .font .getData (.setScale utils/title-label-scale))
(-> msg
(label style)
(assoc :x 0 :y 0 :height 40 :origin-x 0 :origin-y 0 :z 8)

View File

@@ -30,10 +30,12 @@
entity)
(def ui-scale 1.5)
(def ui-scale 1.0)
(def mobile? (= 1.5 ui-scale))
(def max-zoom (if mobile? 0.5 0.75))
(def min-zoom 0.95)
(def button-font-scale (if mobile? 1.0 0.5))
(def title-label-scale (if mobile? 0.5 0.25))
(defn clear-stage [{:keys [^Stage renderer]}]
(.clear renderer))
@@ -244,7 +246,7 @@
(defn get-font [filename]
(let [font (-> (bitmap-font filename)
#_(doto (bitmap-font! :set-scale 0.5 0.5)))
#_(doto (bitmap-font! :set-font-scale 0.5 0.5)))
tr (bitmap-font! font :get-region)
tx (.getTexture tr)]
(call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)