started on nice title.

This commit is contained in:
2015-07-23 22:43:06 -07:00
parent a37ef97368
commit 564a073bb8
8 changed files with 20 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
desktop/resources/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
desktop/resources/title.psd Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,12 +1,12 @@
ui.png
size: 128,64
size: 32,128
format: RGBA8888
filter: Nearest,Nearest
repeat: none
slider
rotate: false
xy: 46, 42
xy: 2, 2
size: 20, 20
split: 8, 8, 8, 8
orig: 20, 20
@@ -14,14 +14,14 @@ slider
index: -1
slider-bar
rotate: false
xy: 2, 2
size: 20, 60
orig: 20, 60
xy: 2, 24
size: 28, 28
orig: 28, 28
offset: 0, 0
index: -1
slider-bar-hover
rotate: false
xy: 24, 2
xy: 2, 54
size: 20, 60
orig: 20, 60
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 627 B

View File

@@ -1 +1 @@
{:sound-volume 86.0, :music-volume 59.0}
{:sound-volume 64.0, :music-volume 55.0}

View File

@@ -37,7 +37,7 @@
s)
(defn center [e]
(assoc e :x (- (/ 1280 2) (/ (.getWidth (:object e)) 2))))
(assoc e :x (- (/ 1280 2) (/ (or (:width e) (.getWidth (:object e))) 2))))
(defscreen title-screen
:on-show
@@ -46,36 +46,39 @@
(utils/setup-viewport screen 1280 960)
(utils/load-settings!)
(let [font (utils/get-font "ego/font.fnt")
start-playing (assoc (label "Begin quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 300 :height 64 :origin-x 0 :origin-y 0)
start-playing (assoc (label "Begin quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 280 :height 64 :origin-x 0 :origin-y 0)
start-playing (center start-playing)
quit (assoc (label "End quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 65 :height 32 :origin-x 0 :origin-y 0)
quit (assoc (label "End quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y (- 280 (* 32 5)) :height 32 :origin-x 0 :origin-y 0)
quit (center quit)
music (utils/make-music "intro.ogg")
ui-skin (skin "ui/ui.json")]
ui-skin (skin "ui/ui.json")
]
(label! start-playing :set-alignment Align/center)
(label! quit :set-alignment Align/center)
{:overlay (assoc (texture "title-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0)
{:overlay (assoc (texture "title.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0)
:fade (assoc (texture "black.png")
:scale-x 80
:scale-y 80
:opacity 1.0
:origin-x 0
:origin-y 0)
:toolbox (center (assoc (nine-patch {:region (:object (texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
:y 90 :width 500 :height 250))
:music-label (-> (label "Music" (style :label font (color 1.0 1.0 1.0 1.0)))
(assoc :x 0 :y 240 :height 32 :origin-x 0 :origin-y 0)
(assoc :x 0 :y (- 280 (* 32 1)) :height 32 :origin-x 0 :origin-y 0)
center)
:music-volume-slider (-> (slider {:min 0 :max 100 :step 1} ui-skin :set-value (:music-volume @utils/settings))
(assoc :x (- (/ 1280 2) 150)
:width 300
:y 195
:y (- 280 (* 32 2))
:hover (skin! ui-skin :get "default-horizontal-hover" Slider$SliderStyle)
:default (skin! ui-skin :get "default-horizontal" Slider$SliderStyle)))
:sound-label (->
(label "FX" (style :label font (color 1.0 1.0 1.0 1.0)))
(assoc :x 0 :y 150 :height 32 :origin-x 0 :origin-y 0)
(assoc :x 0 :y (- 280 (* 32 3)) :height 32 :origin-x 0 :origin-y 0)
center)
@@ -83,7 +86,7 @@
:width 300
:x ( - (/ 1280 2)
150)
:y 105
:y (- 280 (* 32 4))
:hover (skin! ui-skin :get "default-horizontal-hover" Slider$SliderStyle)
:default (skin! ui-skin :get "default-horizontal" Slider$SliderStyle))
:font font
@@ -102,7 +105,7 @@
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
(music! (:music entities) :set-volume (utils/current-music-volume (:volume entities)))
()
(render! screen [(:overlay entities) (:start-playing entities) (:quit entities) (:music-label entities) (:music-volume-slider entities) (:sound-label entities) (:sound-volume-slider entities) (:fade entities) ])
(render! screen [(:overlay entities) (:toolbox entities) (:start-playing entities) (:quit entities) (:music-label entities) (:music-volume-slider entities) (:sound-label entities) (:sound-volume-slider entities) (:fade entities) ])
entities))
:show-screen (fn [entities]