(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)))