better ui.

This commit is contained in:
Bryce Covert
2015-11-11 18:30:32 -08:00
parent 31b401755a
commit 190db3dcd6

View File

@@ -15,7 +15,8 @@
[com.badlogic.gdx.utils.viewport FitViewport]
[com.badlogic.gdx.scenes.scene2d.utils Align]
[com.badlogic.gdx.math Vector3 Vector2 Matrix4]
[com.badlogic.gdx Screen]))
[com.badlogic.gdx Screen]
[play_clj.entities NinePatchEntity]))
(defn ensure-on-screen [talk]
(let [margin-width (* 0.05 1280)
@@ -51,7 +52,7 @@
:on-talk
(fn [{:keys [create-talk target-id color text x y scale scene-viewport] :as screen} [entities]]
(let [font (bitmap-font "ego/font.fnt" )
p (nine-patch {:region (:object (utils/get-texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
p (NinePatchEntity. (skin! (skin "ui/ui.json") :get-patch "ui-bg"))
_ (nine-patch! p :set-padding 25 25 5 15)
bg (drawable :nine-patch (:object p))
@@ -117,13 +118,15 @@
tr (bitmap-font! font :get-region)
scale 1
tx (.getTexture tr)
p (NinePatchEntity. (skin! (skin "ui/ui.json") :get-patch "ui-bg"))
_ (nine-patch! p :set-padding 25 25 5 15)
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)]
{:state {:object nil
:callback nil
:choices []
:last-pos [0 0]
:font font
:np (assoc (nine-patch {:region (:object (utils/get-texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
:np (assoc p
:x 5 :y 5 :width 1270)}}))
:on-render