added scrollbars.
This commit is contained in:
@@ -1,12 +1,20 @@
|
|||||||
|
|
||||||
ui.png
|
ui.png
|
||||||
size: 64,32
|
size: 128,64
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Nearest,Nearest
|
filter: Nearest,Nearest
|
||||||
repeat: none
|
repeat: none
|
||||||
|
scroll-slider
|
||||||
|
rotate: false
|
||||||
|
xy: 2, 2
|
||||||
|
size: 20, 20
|
||||||
|
split: 8, 8, 8, 8
|
||||||
|
orig: 20, 20
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
slider
|
slider
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 32, 10
|
xy: 98, 36
|
||||||
size: 20, 20
|
size: 20, 20
|
||||||
split: 8, 8, 8, 8
|
split: 8, 8, 8, 8
|
||||||
orig: 20, 20
|
orig: 20, 20
|
||||||
@@ -14,15 +22,22 @@ slider
|
|||||||
index: -1
|
index: -1
|
||||||
slider-bar
|
slider-bar
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 2
|
xy: 68, 28
|
||||||
size: 28, 28
|
size: 28, 28
|
||||||
orig: 28, 28
|
orig: 28, 28
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
slider-bar-hover
|
slider-bar-hover
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 2
|
xy: 68, 28
|
||||||
size: 28, 28
|
size: 28, 28
|
||||||
orig: 28, 28
|
orig: 28, 28
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
ui
|
||||||
|
rotate: false
|
||||||
|
xy: 2, 24
|
||||||
|
size: 64, 32
|
||||||
|
orig: 64, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
|||||||
@@ -3,4 +3,10 @@
|
|||||||
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
|
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
|
||||||
default-horizontal: { background: slider, knob: slider-bar }
|
default-horizontal: { background: slider, knob: slider-bar }
|
||||||
default-horizontal-hover: { background: slider, knob: slider-bar-hover }
|
default-horizontal-hover: { background: slider, knob: slider-bar-hover }
|
||||||
}}
|
},
|
||||||
|
|
||||||
|
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
|
||||||
|
default: { vScroll: slider, hScrollKnob: scroll-slider, hScroll: slider, vScrollKnob: scroll-slider }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 689 B |
@@ -19,6 +19,7 @@
|
|||||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||||
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget]
|
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget]
|
||||||
|
[com.badlogic.gdx.scenes.scene2d Group]
|
||||||
[play_clj.entities ActorEntity]
|
[play_clj.entities ActorEntity]
|
||||||
[com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable]
|
[com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable]
|
||||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||||
@@ -198,27 +199,36 @@
|
|||||||
(every-pred :save #(utils/intersects? % [x y]))
|
(every-pred :save #(utils/intersects? % [x y]))
|
||||||
(vals entities))))
|
(vals entities))))
|
||||||
|
|
||||||
|
(defn saves-table [entities]
|
||||||
|
(let [make-cell (fn [image] [image :width 142 :pad 4 4 4 4 :height 104])
|
||||||
|
make-save-screenshot (fn [[save-name save-screenshot]]
|
||||||
|
(ActorEntity. (doto (Group. )
|
||||||
|
(.addActor (:object (doto (image (utils/get-texture "title/screenshot-backdrop.png"))
|
||||||
|
(image! :set-width 142)
|
||||||
|
(image! :set-height 104))))
|
||||||
|
(.addActor (:object (doto (image (texture save-screenshot))
|
||||||
|
(image! :set-x 8)
|
||||||
|
(image! :set-y 8)
|
||||||
|
(image! :set-width 126)
|
||||||
|
(image! :set-height 88)))))))
|
||||||
|
save-screenshots (map make-save-screenshot (:saves-list entities))
|
||||||
|
grouped-screenshots (->> (partition-all 3 save-screenshots)
|
||||||
|
(mapcat (fn [group]
|
||||||
|
(conj (map make-cell group) :row))))]
|
||||||
|
[(doto (scroll-pane (table grouped-screenshots)
|
||||||
|
(skin "ui/ui.json"))
|
||||||
|
(scroll-pane! :set-fade-scroll-bars false))
|
||||||
|
:colspan 3 :height 224 :width 482]))
|
||||||
|
|
||||||
(defn saves-menu [entities]
|
(defn saves-menu [entities]
|
||||||
(make-table (concat [[(make-label "Save Title") :colspan 3 :height 32]
|
(make-table [[(make-label "") :colspan 3 :height 32]
|
||||||
:row
|
:row
|
||||||
[(scroll-pane (table [[(Group. [(image (utils/get-texture "title/screenshot-backdrop.png"))
|
(saves-table entities)
|
||||||
(image (utils/get-texture (second (first (:saves-list entities)))))]) :width 142 :pad 4 4 4 4 :height 104]
|
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
:row
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
[(ActorEntity. (Widget.)) :width 150]
|
||||||
:row
|
[(make-button "Back" :key :back) :width 150]
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
[(make-button "Continue" :key :continue) :width 150]]))
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
|
||||||
:row
|
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]
|
|
||||||
[(image (utils/get-texture "title/screenshot-backdrop.png")) :width 142 :pad 4 4 4 4 :height 104]])
|
|
||||||
(style :scroll-pane nil nil nil nil nil))
|
|
||||||
:colspan 3 :height 224]
|
|
||||||
:row
|
|
||||||
[(ActorEntity. (Widget.)) :width 150]
|
|
||||||
[(make-button "Back" :key :back) :width 150]
|
|
||||||
[(make-button "Continue" :key :continue) :width 150]])))
|
|
||||||
|
|
||||||
|
|
||||||
(defscreen title-screen
|
(defscreen title-screen
|
||||||
|
|||||||
Reference in New Issue
Block a user