other various changes
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
(:import [com.badlogic.gdx Files Gdx]
|
||||
[com.badlogic.gdx.files FileHandle]
|
||||
[com.badlogic.gdx.graphics Pixmap Texture]
|
||||
[play_clj Animation2]
|
||||
[com.badlogic.gdx.graphics.g2d Animation BitmapFont NinePatch
|
||||
|
||||
ParticleEffect TextureAtlas TextureRegion]
|
||||
[play_clj.entities TextureEntity NinePatchEntity
|
||||
ParticleEffectEntity]))
|
||||
@@ -190,7 +192,7 @@
|
||||
|
||||
(defn animation*
|
||||
[duration textures]
|
||||
(Animation. duration
|
||||
(Animation2. duration
|
||||
(u/gdx-array (map #(u/get-obj % :object) textures))
|
||||
(play-mode :normal)))
|
||||
|
||||
@@ -201,14 +203,14 @@
|
||||
[walk-1 walk-2 walk-3]
|
||||
:set-play-mode (play-mode :loop-pingpong))"
|
||||
[duration textures & options]
|
||||
`(u/calls! ^Animation (animation* ~duration ~textures) ~@options))
|
||||
`(u/calls! ^Animation2 (animation* ~duration ~textures) ~@options))
|
||||
|
||||
(defmacro animation!
|
||||
"Calls a single method on an `animation`.
|
||||
|
||||
(animation! object :set-play-mode (play-mode :loop))"
|
||||
[object k & options]
|
||||
(let [object (vary-meta object assoc :tag `Animation)]
|
||||
(let [object (vary-meta object assoc :tag `Animation2)]
|
||||
`(u/call! ~object ~k ~@options)))
|
||||
|
||||
(defn animation->texture
|
||||
@@ -216,7 +218,7 @@
|
||||
time the `screen` has been showing.
|
||||
|
||||
(animation->texture screen anim)"
|
||||
([{:keys [total-time] :as screen} ^Animation animation]
|
||||
(texture* (.getKeyFrame animation total-time true)))
|
||||
([{:keys [total-time] :as screen} ^Animation animation is-looping?]
|
||||
(texture* (.getKeyFrame animation total-time is-looping?))))
|
||||
([{:keys [total-time] :as screen} ^Animation2 animation]
|
||||
(texture* (.getKeyFrame ^Animation2 animation total-time true)))
|
||||
([{:keys [total-time] :as screen} ^Animation2 animation is-looping?]
|
||||
(texture* (.getKeyFrame ^Animation2 animation total-time is-looping?))))
|
||||
|
||||
Reference in New Issue
Block a user