organization.
This commit is contained in:
32
desktop/src-common/advent/screens/dialogue.clj
Normal file
32
desktop/src-common/advent/screens/dialogue.clj
Normal file
@@ -0,0 +1,32 @@
|
||||
(ns advent.screens.dialogue
|
||||
(: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])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]))
|
||||
|
||||
(defscreen talking-screen
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(update! screen :renderer (stage) :camera (orthographic)) [])
|
||||
:on-render
|
||||
(fn [screen entities]
|
||||
(render! screen entities)
|
||||
entities)
|
||||
|
||||
:on-talk
|
||||
(fn [{:keys [create-talk text x y]} entities]
|
||||
[(let [font (bitmap-font "mainfont.fnt" )
|
||||
tr (bitmap-font! font :get-region)
|
||||
tx (.getTexture tr)
|
||||
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
|
||||
talk (assoc (label text (style :label font (color :white)) ) :x (* 4 x) :y (* 4 y))]
|
||||
(label! talk :set-font-scale 1)
|
||||
talk)])
|
||||
|
||||
|
||||
:on-resize (fn [screen entities]
|
||||
(height! screen (game :height))))
|
||||
Reference in New Issue
Block a user