some ending goodness
This commit is contained in:
47
desktop/src-common/advent/screens/credits.clj
Normal file
47
desktop/src-common/advent/screens/credits.clj
Normal file
@@ -0,0 +1,47 @@
|
||||
(ns advent.screens.credits
|
||||
(:require [play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
[advent.pathfind]
|
||||
[advent.tween :as tween]
|
||||
[advent.zone :as zone]
|
||||
[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 Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
(defscreen credits
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(utils/setup-viewport screen 320 240)
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
{:fade (assoc (texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 0.0
|
||||
:origin-x 0
|
||||
:origin-y 0)
|
||||
:the-end (assoc (texture "the-end.png") :x 0 :y 0)
|
||||
:tweens {:fade-in
|
||||
(tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 5.0 :ease tween/ease-out-cubic)}}
|
||||
)
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
|
||||
|
||||
(render! screen [(:the-end entities) (:fade entities)])
|
||||
entities))
|
||||
|
||||
|
||||
:on-touch-up (fn [screen [entities]]
|
||||
(set-screen! @(resolve 'advent.core/advent) @(resolve 'advent.screens.title/title-screen)))
|
||||
|
||||
:on-resize (fn [{:keys [width height viewport]} entities]
|
||||
(.update viewport width height)))
|
||||
|
||||
Reference in New Issue
Block a user