fonts beginning to look good.

This commit is contained in:
Bryce Covert
2016-02-24 09:24:08 -08:00
parent 21947f4ea2
commit 0cacfdac1f
4 changed files with 110 additions and 105 deletions

View File

@@ -58,18 +58,22 @@
bg (drawable :nine-patch (:object p))
_ (bitmap-font! font :set-markup-enabled true)
tr (bitmap-font! font :get-region)
scale (or (min (max scale 0.75) 1) 1)
scale (/ scale 2)
scale (or (min (max scale 0.35) 0.5) 0.5)
tx (.getTexture tr)
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
style (style :label font color)
#__ #_(set! (.background style) bg)
#_#__ (set! (.background style) bg)
[source-x source-y] [x y]
[x y] (scene-world->talk-world scene-viewport [source-x
source-y])
talk (assoc (label text style :set-font-scale scale :set-alignment Align/bottom)
:source-x source-x :source-y source-y
)
talk (-> (label text style :set-font-scale scale :set-alignment Align/bottom)
(assoc :source-x source-x :source-y source-y)
(doto
(label! :set-wrap true)
(#(label! % :set-width (min 700 (+ 50 (* scale (label! % :get-width))))))
))
x (- x (/ (label! talk :get-width) 2))
talk (assoc talk :x x :y y :id id)
talk (ensure-on-screen talk)]
@@ -146,13 +150,14 @@
font (get-in entities [:state :font])]
(-> entities
(into (for [[[text] i] (map vector choices (range))
:let [e (label text (style :label font (color 0.6 1.0 1.0 1.0)) :set-alignment Align/bottom)
:let [e (label text (style :label font (color 0.6 1.0 1.0 1.0)) :set-alignment Align/bottomLeft)
e (assoc e :height choice-height :x 30 :y (+ 25 (* choice-height (- choice-count i 1))) :index i)
e (style-label e font (get-in entities [:state :last-pos]))]]
[i (doto e
(label! :set-x (:x e))
(label! :set-y (:y e))
(label! :set-height (:height e)))]))
(label! :set-height (:height e))
(label! :set-font-scale 0.5))]))
(assoc-in [:state :choices] choices)
(assoc-in [:state :callback] callback)
(assoc-in [:state :np :height] (* choice-height (inc choice-count))))))

View File

@@ -78,7 +78,7 @@
(defn nice-trophy-dialogue [entities]
{:run #(actions/respond entities %
:game-player "Thanks. I'm the reigning champ in the annual Town of Remington Junior Smarty Pants Derby."
:game-player "Thanks. I'm the reigning champ in the annual Town of Remington Junior Smarty Pants Derby. That's because I'm the smartest guy in town, yep I sure am! I really am that smart."
:game-player "I earned it with my wisdom and sharp intellect."
:game-player "Oh, I'm guessing you want it? "
:game-player "Maybe to prove your wisdom and pull the Sword of Blergh?"