This commit is contained in:
Bryce Covert
2016-08-03 20:26:57 -07:00
parent 60c047d13d
commit 01cc791119
22 changed files with 11 additions and 9 deletions

9
src/play_clj/g2d.clj Normal file → Executable file
View File

@@ -40,11 +40,11 @@
(-> (or (u/load-asset arg Texture)
(Texture. ^String arg))
TextureRegion.)
(isa? (type arg) Pixmap)
(instance? Pixmap arg)
(-> ^Pixmap arg Texture. TextureRegion.)
(isa? (type arg) Texture)
(instance? Texture arg)
(-> ^Texture arg TextureRegion.)
(isa? (type arg) TextureEntity)
(instance? TextureEntity )
(-> ^TextureRegion (:object arg) TextureRegion.)
:else
arg)))
@@ -208,7 +208,8 @@
(animation! object :set-play-mode (play-mode :loop))"
[object k & options]
`(u/call! ^Animation ~object ~k ~@options))
(let [object (vary-meta object assoc :tag `Animation)]
`(u/call! ~object ~k ~@options)))
(defn animation->texture
"Returns a `texture` entity with a frame from `animation` based on the total