diff --git a/desktop/resources/ui/button.9.png b/desktop/resources/ui/button.9.png new file mode 100644 index 00000000..58f31b33 Binary files /dev/null and b/desktop/resources/ui/button.9.png differ diff --git a/desktop/resources/ui/button.9.pxi b/desktop/resources/ui/button.9.pxi new file mode 100644 index 00000000..610cd2f5 Binary files /dev/null and b/desktop/resources/ui/button.9.pxi differ diff --git a/desktop/resources/ui/button.pressed.9.png b/desktop/resources/ui/button.pressed.9.png new file mode 100644 index 00000000..4aecb238 Binary files /dev/null and b/desktop/resources/ui/button.pressed.9.png differ diff --git a/desktop/resources/ui/slider.9.png b/desktop/resources/ui/slider.9.png index 01f2b249..e3fa8cda 100644 Binary files a/desktop/resources/ui/slider.9.png and b/desktop/resources/ui/slider.9.png differ diff --git a/desktop/resources/ui/ui.atlas b/desktop/resources/ui/ui.atlas index 7ca89cbe..39b72533 100644 --- a/desktop/resources/ui/ui.atlas +++ b/desktop/resources/ui/ui.atlas @@ -1,12 +1,28 @@ ui.png -size: 128,32 +size: 256,64 format: RGBA8888 filter: Nearest,Nearest repeat: none +button + rotate: false + xy: 2, 2 + size: 52, 40 + split: 24, 24, 12, 24 + orig: 52, 40 + offset: 0, 0 + index: -1 +button.pressed + rotate: false + xy: 56, 2 + size: 52, 40 + split: 24, 24, 16, 20 + orig: 52, 40 + offset: 0, 0 + index: -1 screenshot-image-button rotate: false - xy: 54, 10 + xy: 162, 22 size: 20, 20 split: 8, 8, 8, 8 orig: 20, 20 @@ -14,7 +30,7 @@ screenshot-image-button index: -1 screenshot-image-button-active rotate: false - xy: 32, 10 + xy: 140, 22 size: 20, 20 split: 8, 8, 8, 8 orig: 20, 20 @@ -22,7 +38,7 @@ screenshot-image-button-active index: -1 scroll-slider rotate: false - xy: 76, 10 + xy: 184, 22 size: 20, 20 split: 8, 8, 8, 8 orig: 20, 20 @@ -30,7 +46,7 @@ scroll-slider index: -1 slider rotate: false - xy: 98, 10 + xy: 206, 22 size: 20, 20 split: 8, 8, 8, 8 orig: 20, 20 @@ -38,14 +54,14 @@ slider index: -1 slider-bar rotate: false - xy: 2, 2 + xy: 110, 14 size: 28, 28 orig: 28, 28 offset: 0, 0 index: -1 slider-bar-hover rotate: false - xy: 2, 2 + xy: 110, 14 size: 28, 28 orig: 28, 28 offset: 0, 0 diff --git a/desktop/resources/ui/ui.json b/desktop/resources/ui/ui.json index 46204391..7de992a2 100644 --- a/desktop/resources/ui/ui.json +++ b/desktop/resources/ui/ui.json @@ -1,5 +1,11 @@ { - + com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: ego/font.fnt } } + com.badlogic.gdx.graphics.Color: { + white: { a: 1, b: 1, g: 1, r: 1 }, + gray: { a: 1, b: 0.5, g: 0.5, r: 0.5}, + pressed: { a: 1.0, b: 0.9, g: 0.9, r: 0.9 }, + yellow: {hex: DFD114FF}, + }, com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { default-horizontal: { background: slider, knob: slider-bar } default-horizontal-hover: { background: slider, knob: slider-bar-hover } @@ -12,6 +18,13 @@ com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { default: { down: screenshot-image-button-active, up: screenshot-image-button, checked: screenshot-image-button-active} active: { down: screenshot-image-button-active, up: screenshot-image-button-active, checked: screenshot-image-button-active} +}, + + +com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { + default: { font: default-font, down: button.pressed, up: button, fontColor: white, overFontColor: yellow, unpressedOffsetY: 0, pressedOffsetY: -4, downFontColor: pressed, disabledFontColor: gray} } + + } diff --git a/desktop/resources/ui/ui.png b/desktop/resources/ui/ui.png index c37f1081..1233f676 100644 Binary files a/desktop/resources/ui/ui.png and b/desktop/resources/ui/ui.png differ diff --git a/desktop/resources/uiskin.json b/desktop/resources/uiskin.json index 551e3f56..262dd81d 100644 --- a/desktop/resources/uiskin.json +++ b/desktop/resources/uiskin.json @@ -1,5 +1,5 @@ { -com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, +com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: ego/font.fnt } }, com.badlogic.gdx.graphics.Color: { green: { a: 1, b: 0, g: 1, r: 0 }, white: { a: 1, b: 1, g: 1, r: 1 }, diff --git a/desktop/src-common/advent/screens/title.clj b/desktop/src-common/advent/screens/title.clj index ab553620..7d00f306 100644 --- a/desktop/src-common/advent/screens/title.clj +++ b/desktop/src-common/advent/screens/title.clj @@ -19,7 +19,7 @@ (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter Color] [com.badlogic.gdx.graphics.g2d TextureRegion] [com.badlogic.gdx.utils.viewport FitViewport] - [com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup] + [com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle] [com.badlogic.gdx.scenes.scene2d Group Actor] [play_clj.entities ActorEntity] [com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable] @@ -125,13 +125,7 @@ (tween/tween :fade-out-music screen [:volume] 1.0 0.0 1.0))))) (defn button-style [] - (let [font (utils/get-font "ego/font.fnt") - style (style :text-button nil nil nil font)] - (set! (.fontColor style) button-color) - (set! (.overFontColor style) (color :yellow)) - (set! (.downFontColor style) (Color/valueOf "49224aff")) - (set! (.disabledFontColor style) (color :gray)) - style)) + (skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle)) (defn save-object [a] (.setUserObject ^Actor (:object a) a) @@ -183,28 +177,29 @@ (defn main-menu [] (let [start-playing-label (quest-label) is-starting? (= "Begin quest" start-playing-label)] - (make-table [[(make-button start-playing-label :key :continue-or-start) :height 32] + (make-table [[(make-button start-playing-label :key :continue-or-start) :height 56 :pad-bottom 4 :width 250] :row [(doto (make-button "Load" :key :load) - (text-button! :set-disabled (not (seq (utils/snapshot-list))))) :height 32] + (text-button! :set-disabled (not (seq (utils/snapshot-list))))) :height 56 :pad-bottom 4 :width 250] :row [(doto (make-button "Chapters" :key :chapters) (text-button! :set-disabled (not (->> (utils/get-chapters) (vals) (filter identity) - seq)))) :height 32] + seq)))) :height 56 :pad-bottom 4 :width 250] + + :row + [(make-button "Settings" :key :settings) :height 56 :pad-bottom 4 :width 250] + + + + + + + + :row - [(make-label "Music" label-color) :height 32] - :row - [(make-slider (:music-volume @utils/settings) :key :music-volume-slider) :height 32 :width 305] - :row - [(make-label "FX" label-color) :height 32] - :row - [(make-slider (:sound-volume @utils/settings) :key :sound-volume-slider) :height 32 :width 305] - :row - [(make-button "Fullscreen" :key :toggle-fullscreen) :height 32] - :row - [(make-button "End quest" :key :end-quest) :height 32] + [(make-button "End quest" :key :end-quest) :height 56 :width 250] ]))) (defn chapters-menu [] @@ -216,15 +211,10 @@ (saves/chapter-name chapter) "---") :chapter (chapter chapters)) - (text-button! :set-disabled (nil? (chapter chapters)))) :height 32] + (text-button! :set-disabled (nil? (chapter chapters)))) :height 56 :pad-bottom 4] :row])) - [[(ActorEntity. (Widget.)) :height 32] - :row - [(ActorEntity. (Widget.)) :height 32] - :row - [(ActorEntity. (Widget.)) :height 32] - :row - (make-button "Back" :key :back)])))) + [ + [ (make-button "Back" :key :back) :height 56]])))) (defn get-selected-save [entities [x y]] (first (filter @@ -276,9 +266,9 @@ :row (saves-table entities stage) :row - [delete-button :width 100] - [(make-button "Back" :key :back) :width 100] - [continue-button :width 100]]) + [delete-button :width 100 :height 56] + [(make-button "Back" :key :back) :width 100 :height 56] + [continue-button :width 100 :height 56]]) :save-label save-label :delete-button delete-button :continue-button continue-button)))