testing out alternative font.

This commit is contained in:
Bryce Covert
2016-02-22 21:21:45 -08:00
parent 42bcdbc423
commit 3f88c8cd74
12 changed files with 453 additions and 212 deletions

View File

@@ -75,7 +75,7 @@
(if next-role
(-> entities
(assoc :role (center (assoc (label next-role (get-role-style entities 0.0) :set-alignment Align/center) :x 640 :y 480 )))
(assoc :person (center (assoc (label next-person (get-person-style entities 0.0) :set-alignment Align/center) :x 640 :y 440 )))
(assoc :person (center (assoc (label next-person (get-person-style entities 0.0) :set-alignment Align/center) :x 640 :y 430 )))
(assoc-in [:tweens [:fade :role :in]] (chain-tweens screen entities :role))
(assoc-in [:tweens [:fade :person :in]] (chain-tweens screen entities :person))
(assoc :remaining-messages remaining-messages))

View File

@@ -67,7 +67,7 @@
[x y] (scene-world->talk-world scene-viewport [source-x
source-y])
talk (assoc (label text style :set-font-scale scale :set-alignment Align/center)
talk (assoc (label text style :set-font-scale scale :set-alignment Align/bottom)
:source-x source-x :source-y source-y
)
x (- x (/ (label! talk :get-width) 2))
@@ -98,7 +98,7 @@
:on-resize (fn [{:keys [viewport width height]} entities]
(.update viewport width height)))
(def choice-height 30)
(def choice-height 40)
@@ -146,8 +146,8 @@
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)))
e (assoc e :height 30 :x 30 :y (+ 30 (* choice-height (- choice-count i 1))) :index i)
:let [e (label text (style :label font (color 0.6 1.0 1.0 1.0)) :set-alignment Align/bottom)
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))
@@ -155,7 +155,7 @@
(label! :set-height (:height e)))]))
(assoc-in [:state :choices] choices)
(assoc-in [:state :callback] callback)
(assoc-in [:state :np :height] (* 30 (inc choice-count))))))
(assoc-in [:state :np :height] (* choice-height (inc choice-count))))))
:on-touch-up (fn [screen [entities]]
(let [[x y] (utils/unproject screen)]

View File

@@ -562,7 +562,7 @@
(walk-to-player entities)
(actions/talk entities :game-player "Don't touch my books!")))
:game-player (assoc (utils/get-texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191
:talk-color (color 1.0 0.3 0.2 1.0)
:talk-color (color 1.0 0.3 0.4 1.0)
:script (actions/get-script entities (do-game-player-dialogue entities))
:writing-sound (utils/load-sound "inside-castle/writing.ogg")
:facing :left

View File

@@ -141,6 +141,7 @@
([msg & rest]
(let [button (merge (text-button msg (button-style))
(apply hash-map rest))]
(doto button save-object ))))
(defn make-label
@@ -150,9 +151,9 @@
(let [font (utils/get-font "ego/font.fnt")]
(-> msg
(label (style :label font (or col (color 1.0 0.3 0.3 1.0))))
(assoc :x 0 :y 0 :height 32 :origin-x 0 :origin-y 0 :z 8)
(assoc :x 0 :y 0 :height 40 :origin-x 0 :origin-y 0 :z 8)
center
(doto (label! :set-alignment Align/center))))))
(doto (label! :set-alignment Align/bottom))))))
(defn make-slider [initial-value & rest]
(let [ui-skin (skin "ui/ui.json")
@@ -167,7 +168,7 @@
save-object)))
(defn stack-y [label base index]
(assoc label :y (- base (* 32 index))))
(assoc label :y (- base (* 50 index))))
(defn make-table [children]
(-> children
@@ -221,13 +222,13 @@
(defn settings-menu []
(let [fullscreen-button (make-button "Fullscreen" :key :toggle-fullscreen)]
(assoc (make-table [[(make-label "Settings" label-color) :height 32 :pad-bottom 4]
(assoc (make-table [[(make-label "Settings" label-color) :height 40 :pad-bottom 4]
:row
[(make-label "Music" label-color) :height 32 :pad-bottom 4]
[(make-label "Music" label-color) :height 40 :pad-bottom 4]
:row
[(make-slider (:music-volume @utils/settings) :key :music-volume-slider) :width 240 :pad-bottom 4]
:row
[(make-label "FX" label-color) :height 32 :width 200 :pad-bottom 4]
[(make-label "FX" label-color) :height 40 :width 200 :pad-bottom 4]
:row
[(make-slider (:sound-volume @utils/settings) :key :sound-volume-slider) :width 240 :pad-bottom 4]
:row
@@ -275,7 +276,7 @@
(scroll-pane! :set-fade-scroll-bars false))]
(.setScrollFocus stage (:object scroll-pane))
[scroll-pane
:colspan 3 :height 212 :pad-bottom 4 :width 472]))
:colspan 3 :height 190 :pad-bottom 4 :width 472]))
(defn saves-menu [entities stage]
(let [save-label (make-label "" label-color)
@@ -283,7 +284,7 @@
(text-button! :set-disabled true))
delete-button (doto (make-button "Delete" :key :delete)
(text-button! :set-disabled true))]
(assoc (make-table [[save-label :colspan 3 :height 32]
(assoc (make-table [[save-label :colspan 3 :height 55]
:row
(saves-table entities stage)
:row