supporting different dialogue colors.
This commit is contained in:
@@ -255,6 +255,8 @@
|
||||
height (* scale 36)]
|
||||
(screen! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [:room :entities target-id :x]) :y (+ (get-in entities [:room :entities target-id :y]) height)
|
||||
:color (get-in entities [:room :entities target-id :talk-color])
|
||||
|
||||
:target-id target-id
|
||||
:scale scale)
|
||||
(if animate?
|
||||
|
||||
@@ -33,15 +33,14 @@
|
||||
entities)
|
||||
|
||||
:on-talk
|
||||
(fn [{:keys [create-talk target-id text x y scale]} [entities]]
|
||||
(fn [{:keys [create-talk target-id color text x y scale]} [entities]]
|
||||
(let [font (bitmap-font "ego/font.fnt" )
|
||||
_ (bitmap-font! font :set-markup-enabled true)
|
||||
tr (bitmap-font! font :get-region)
|
||||
scale (or (min (max scale 0.75) 1) 1)
|
||||
tx (.getTexture tr)
|
||||
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
|
||||
talk (assoc (label text (style :label font (if (= :ego target-id)
|
||||
(color :white)
|
||||
(color :yellow)))) :y (* 4 y))]
|
||||
talk (assoc (label text (style :label font color)) :y (* 4 y))]
|
||||
(label! talk :set-font-scale scale)
|
||||
(label! talk :set-alignment Align/center)
|
||||
(assoc entities target-id (-> talk
|
||||
|
||||
@@ -167,6 +167,7 @@
|
||||
:right {:stand warriors-stand
|
||||
:talk warriors-stand}
|
||||
:facing :right
|
||||
:talk-color (color 1.0 0.4 0.3 1.0)
|
||||
:script (actions/get-script entities
|
||||
(do-warrior-dialogue entities)
|
||||
))
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
:right {:talk wizard-talk
|
||||
:stand wizard-stand
|
||||
:disappear wizard-disappear}
|
||||
:talk-color (color 0.75 0.1 1.0 1.0)
|
||||
:facing :left
|
||||
:script (actions/get-script entities (do-wizard-dialogue entities)))
|
||||
:stand)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
(< (dist-to-sheep entities) 45))
|
||||
|
||||
(defn wizard-dialogue [entities]
|
||||
(actions/do-dialogue entities :ego "Hello there Gandarf!" :wizard "Oh no, not you again!")
|
||||
(actions/do-dialogue entities :ego "Hello there [RED]Gandarf[]!" :wizard "Oh no, not you again!")
|
||||
(actions/present-choices entities
|
||||
{:choices ["What do you mean, \"Not you again?\""
|
||||
{:run #(actions/respond entities % :wizard "I mean, you've wrecked my life and I never want to see you again.")
|
||||
|
||||
@@ -164,6 +164,7 @@
|
||||
:step-sound (sound "ego/step.ogg")
|
||||
:scale-x start-scale
|
||||
:scale-y start-scale
|
||||
:talk-color (color 0.5 0.9 1.0 1.0)
|
||||
|
||||
:mouse-in? (fn [entities x y]
|
||||
(let [{entity-x :x entity-y :y region :object scale :scale-x} (get-in entities [:room :entities :ego])
|
||||
|
||||
Reference in New Issue
Block a user