better ui.
This commit is contained in:
@@ -15,7 +15,8 @@
|
|||||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||||
[com.badlogic.gdx.math Vector3 Vector2 Matrix4]
|
[com.badlogic.gdx.math Vector3 Vector2 Matrix4]
|
||||||
[com.badlogic.gdx Screen]))
|
[com.badlogic.gdx Screen]
|
||||||
|
[play_clj.entities NinePatchEntity]))
|
||||||
|
|
||||||
(defn ensure-on-screen [talk]
|
(defn ensure-on-screen [talk]
|
||||||
(let [margin-width (* 0.05 1280)
|
(let [margin-width (* 0.05 1280)
|
||||||
@@ -51,7 +52,7 @@
|
|||||||
:on-talk
|
:on-talk
|
||||||
(fn [{:keys [create-talk target-id color text x y scale scene-viewport] :as screen} [entities]]
|
(fn [{:keys [create-talk target-id color text x y scale scene-viewport] :as screen} [entities]]
|
||||||
(let [font (bitmap-font "ego/font.fnt" )
|
(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)
|
_ (nine-patch! p :set-padding 25 25 5 15)
|
||||||
|
|
||||||
bg (drawable :nine-patch (:object p))
|
bg (drawable :nine-patch (:object p))
|
||||||
@@ -117,13 +118,15 @@
|
|||||||
tr (bitmap-font! font :get-region)
|
tr (bitmap-font! font :get-region)
|
||||||
scale 1
|
scale 1
|
||||||
tx (.getTexture tr)
|
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)]
|
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)]
|
||||||
{:state {:object nil
|
{:state {:object nil
|
||||||
:callback nil
|
:callback nil
|
||||||
:choices []
|
:choices []
|
||||||
:last-pos [0 0]
|
:last-pos [0 0]
|
||||||
:font font
|
: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)}}))
|
:x 5 :y 5 :width 1270)}}))
|
||||||
|
|
||||||
:on-render
|
:on-render
|
||||||
|
|||||||
Reference in New Issue
Block a user