Files
gitea-docker/desktop/src-common/advent/screens/fade.clj
Bryce Covert bf9e2a059b small tweaks.
2015-09-14 10:14:24 -07:00

43 lines
1.3 KiB
Clojure

(ns advent.screens.fade
(: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.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 fade-screen
:on-show
(fn [screen entities]
(utils/setup-viewport screen 320 240)
{:fade (assoc (utils/get-texture "black.png")
:scale-x 100
:scale-y 100
:x -1
:y -1
:opacity 0.0
:origin-x 0
:origin-y 0)})
:on-render
(fn [screen [entities]]
(render! screen [(:fade entities)])
entities)
:update-fade (fn [{:keys [opacity]} [entities]]
(assoc-in entities [:fade :opacity] opacity))
:on-resize (fn [{:keys [width height viewport]} entities]
(.update viewport width height)))