mobile prep
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
:manifest {"Implementation-Version" ~version}
|
||||
|
||||
:uberjar-name "advent-standalone.jar"
|
||||
:dependencies [[com.badlogicgames.gdx/gdx "1.5.3"]
|
||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.5.3"]
|
||||
[com.badlogicgames.gdx/gdx-platform "1.5.3" :classifier "natives-desktop"]
|
||||
[org.clojure/clojure "1.6.0"]
|
||||
:dependencies [[com.badlogicgames.gdx/gdx "1.9.3"]
|
||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"]
|
||||
[com.badlogicgames.gdx/gdx-platform "1.9.3" :classifier "natives-desktop"]
|
||||
[org.clojure/clojure "1.8.0"]
|
||||
[play-clj "0.4.5-BRYCE"]
|
||||
[log4j/log4j "1.2.16"]
|
||||
[org.clojure/data.priority-map "0.0.5"]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
[advent.utils :as utils])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
@@ -149,7 +149,7 @@
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(utils/setup-viewport screen 1280 960)
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :main))
|
||||
(let [font (bitmap-font "ego/font.fnt" )]
|
||||
{:font font
|
||||
:bg (assoc (utils/get-texture "black.png")
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx.math Vector3 Vector2 Matrix4]
|
||||
[com.badlogic.gdx Screen]
|
||||
[play_clj.entities NinePatchEntity]))
|
||||
@@ -58,7 +58,6 @@
|
||||
_ (nine-patch! p :set-padding 25 25 5 15)
|
||||
|
||||
bg (drawable :nine-patch (:object p))
|
||||
_ (bitmap-font! font :set-markup-enabled true)
|
||||
tr (bitmap-font! font :get-region)
|
||||
scale (/ scale 2)
|
||||
scale (or (min (max scale 0.2) 0.25) 0.25)
|
||||
@@ -208,7 +207,6 @@
|
||||
_ (nine-patch! p :set-padding 25 25 5 15)
|
||||
|
||||
bg (drawable :nine-patch (:object p))
|
||||
_ (bitmap-font! font :set-markup-enabled true)
|
||||
tr (bitmap-font! font :get-region)
|
||||
|
||||
tx (.getTexture tr)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
[advent.utils :as utils])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
@@ -881,7 +881,7 @@ void main ()
|
||||
last)
|
||||
(= active was-active))
|
||||
(let [image-path (if active "cursor_light.png" "cursor.png")]
|
||||
(input! :set-cursor-image (utils/cursor image-path (or (:cursor new-current) new-current)) 0 0)))
|
||||
(graphics! :set-cursor (utils/cursor image-path (or (:cursor new-current) new-current)))))
|
||||
(update-in entities [:cursor ] assoc :last new-current
|
||||
:was-active active))
|
||||
entities))
|
||||
@@ -1204,7 +1204,7 @@ void main ()
|
||||
:on-resume (fn [screen [{{:keys [current override last active was-active]} :cursor :as entities}]]
|
||||
(let [current (or override current)
|
||||
image-path (if active "cursor_light.png" "cursor.png")]
|
||||
(input! :set-cursor-image (utils/cursor image-path (or (:cursor current) current)) 0 0))
|
||||
(graphics! :set-cursor (utils/cursor image-path (or (:cursor current) current))))
|
||||
(doseq [[k [start time fn]] (get-in entities [:room :timers])]
|
||||
(add-timer! screen k start time)))
|
||||
|
||||
@@ -1384,7 +1384,7 @@ void main ()
|
||||
(when-not (or (get-in entities [:tweens :fade-out])
|
||||
(get-in entities [:tweens :fade-in]))
|
||||
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
(-> entities
|
||||
(assoc-in [:closing? :value] true)
|
||||
(assoc-in [:tweens :fade-out-music]
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle CheckBox$CheckBoxStyle CheckBox Button]
|
||||
[com.badlogic.gdx.scenes.scene2d Group Actor]
|
||||
[play_clj.entities ActorEntity]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils NinePatchDrawable TextureRegionDrawable]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
@@ -97,7 +98,7 @@
|
||||
(utils/setup-viewport screen 1280 960)
|
||||
(log/info "Starting splash screen.")
|
||||
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
|
||||
(let [screen (assoc screen :total-time 0)
|
||||
pop-anim (make-anim-seq "POPPixelLogo_02" [320 240] 0.05 (range 200))
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle CheckBox$CheckBoxStyle CheckBox Button]
|
||||
[com.badlogic.gdx.scenes.scene2d Group Actor]
|
||||
[play_clj.entities ActorEntity]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable BaseDrawable]
|
||||
[com.badlogic.gdx.utils Align]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils NinePatchDrawable TextureRegionDrawable BaseDrawable]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
@@ -70,7 +71,7 @@
|
||||
|
||||
(defn quit [screen entities]
|
||||
(do (log/info "Quitting.")
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
(-> entities
|
||||
(assoc-in [:tweens :fade-out]
|
||||
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
|
||||
@@ -116,7 +117,7 @@
|
||||
|
||||
(defn start-playing [screen entities save]
|
||||
(do (log/info "Starting/Continuing quest.")
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
(-> entities
|
||||
(assoc-in [:tweens :fade-out]
|
||||
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
|
||||
@@ -133,7 +134,7 @@
|
||||
(defn button-style []
|
||||
(let [style (skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle)
|
||||
tx (-> style .font .getRegion .getTexture)]
|
||||
(-> style .font (.setScale 0.5 0.5))
|
||||
|
||||
(call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
|
||||
style))
|
||||
|
||||
@@ -161,7 +162,7 @@
|
||||
(let [s (skin! (skin "ui/ui.json") :get CheckBox$CheckBoxStyle)]
|
||||
(-> s
|
||||
.font
|
||||
(.setScale 0.25 0.25))
|
||||
)
|
||||
|
||||
(doto (merge (check-box msg s)
|
||||
(apply hash-map rest))
|
||||
@@ -178,7 +179,6 @@
|
||||
_ (nine-patch! p :set-padding 0 0 0 0)
|
||||
bg (drawable :nine-patch (:object p))
|
||||
style (style :label font (or col (color 1.0 0.3 0.3 1.0)))
|
||||
_ (bitmap-font! font :set-markup-enabled true)
|
||||
#_#__ (set! (.background style) bg)]
|
||||
(-> msg
|
||||
(label style)
|
||||
@@ -350,7 +350,7 @@
|
||||
balloon (utils/make-anim "title/balloon.png" [15 30] 0.45 (range 4))
|
||||
banner-back (utils/make-anim "title/banner-back.png" [180 42] 0.2 [0 1 2 1 0 1 2 1])]
|
||||
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
|
||||
(let [entities {:background (assoc (utils/get-texture "title/background.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 0)
|
||||
:cloud-background (assoc (utils/get-texture "title/clouds.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 2)
|
||||
@@ -408,7 +408,7 @@
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
:finish #(do
|
||||
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :main))
|
||||
(utils/play-music (:music %)) %)
|
||||
:ease tween/ease-in-quadratic)}}
|
||||
]
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
(pixmap! resized :draw-pixmap base-cursor (* index 18) 0 16 16
|
||||
0 0 target-width target-height)
|
||||
|
||||
resized ))
|
||||
(graphics! :new-cursor resized 0 0)))
|
||||
|
||||
(defn get-texture [path]
|
||||
(let [atlas-name (str/replace path #".png" "")
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
(defn get-font [filename]
|
||||
(let [font (-> (bitmap-font filename)
|
||||
(doto (bitmap-font! :set-scale 0.5 0.5)))
|
||||
#_(doto (bitmap-font! :set-scale 0.5 0.5)))
|
||||
tr (bitmap-font! font :get-region)
|
||||
tx (.getTexture tr)]
|
||||
(call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
|
||||
@@ -483,7 +483,7 @@
|
||||
(do
|
||||
(log/info "Making windowed 1280x960 decorated window")
|
||||
(System/setProperty "org.lwjgl.opengl.Window.undecorated", "false")
|
||||
(.setDisplayMode Gdx/graphics 1280 960 false)))
|
||||
(.setWindowedMode Gdx/graphics 1280 960)))
|
||||
|
||||
(defn is-fullscreen?-normal []
|
||||
(.isFullscreen Gdx/graphics))
|
||||
|
||||
Reference in New Issue
Block a user