diff --git a/project.clj b/project.clj index e4ce071..77ec8bc 100755 --- a/project.clj +++ b/project.clj @@ -3,9 +3,9 @@ :url "https://github.com/oakes/play-clj" :license {:name "Public Domain" :url "http://unlicense.org/UNLICENSE"} - :dependencies [[com.badlogicgames.gdx/gdx "1.5.3"] - [com.badlogicgames.gdx/gdx-box2d "1.5.3"] - [com.badlogicgames.gdx/gdx-bullet "1.5.3"] + :dependencies [[com.badlogicgames.gdx/gdx "1.9.5"] + [com.badlogicgames.gdx/gdx-box2d "1.9.5"] + [com.badlogicgames.gdx/gdx-bullet "1.9.5"] [org.clojure/clojure "1.6.0"]] :repositories [["sonatype" "https://oss.sonatype.org/content/repositories/releases/"]] diff --git a/src-java/play_clj/Animation2.java b/src-java/play_clj/Animation2.java new file mode 100644 index 0000000..2200aba --- /dev/null +++ b/src-java/play_clj/Animation2.java @@ -0,0 +1,45 @@ +package play_clj; +import com.badlogic.gdx.graphics.g2d.Animation; +import java.util.Arrays; +import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.utils.Array; + +public class Animation2 extends Animation { + public Animation2(float x ,TextureRegion[] y) { + super(x, y); + } + + + public Animation2(float x , Array y, Animation.PlayMode z) { + super(x, y, z); + } + + public TextureRegion getKeyFrame(float stateTime) { + return super.getKeyFrame(stateTime); + } + + public TextureRegion getKeyFrame(float stateTime, boolean looping) { + return super.getKeyFrame(stateTime, looping); + } + + + public TextureRegion getKeyFrame(double stateTime) { + return super.getKeyFrame((float) stateTime); + } + + public TextureRegion getKeyFrame(double stateTime, boolean looping) { + return super.getKeyFrame((float)stateTime, looping); + } + + public TextureRegion getKeyFrame(int stateTime) { + return super.getKeyFrame((float)stateTime); + } + + public TextureRegion getKeyFrame(int stateTime, boolean looping) { + return super.getKeyFrame((float)stateTime, looping); + } + + public Object[] getRawKeyFrames() { + return super.getKeyFrames(); + } +} diff --git a/src/play_clj/g2d.clj b/src/play_clj/g2d.clj index bee5565..77a5e9e 100755 --- a/src/play_clj/g2d.clj +++ b/src/play_clj/g2d.clj @@ -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?)))) diff --git a/texture b/texture new file mode 100644 index 0000000..2b231eb --- /dev/null +++ b/texture @@ -0,0 +1,11 @@ +src/play_clj/g2d.clj:(defn animation->texture +src/play_clj/g2d.clj: (animation->texture screen anim)" +doclet/resources/classes.edn: "AnimationController" {"animation-controller" :methods +doclet/resources/classes.edn: "animation-controller!" :methods} +src/play_clj/g3d.clj:; animation-controller +src/play_clj/g3d.clj:(defn animation-controller* +src/play_clj/g3d.clj:(defmacro animation-controller +src/play_clj/g3d.clj: (animation-controller model-entity)" +src/play_clj/g3d.clj: `(let [^AnimationController object# (animation-controller* ~entity)] +src/play_clj/g3d.clj:(defmacro animation-controller! +src/play_clj/g3d.clj: "Calls a single method on an `animation-controller`."