diff --git a/project.clj b/project.clj index c911d46..3b6f07f 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject play-clj "0.4.5-SNAPSHOT" +(defproject play-clj "0.4.5-BRYCE" :description "A libGDX wrapper for easy cross-platform game development" :url "https://github.com/oakes/play-clj" :license {:name "Public Domain" diff --git a/src/play_clj/entities.clj b/src/play_clj/entities.clj index 3e0e1d4..049e205 100644 --- a/src/play_clj/entities.clj +++ b/src/play_clj/entities.clj @@ -21,20 +21,22 @@ (defrecord TextureEntity [object] Entity (draw! [{:keys [^TextureRegion object x y width height - scale-x scale-y angle origin-x origin-y]} + scale-x scale-y angle origin-x origin-y something]} _ batch] (let [x (- (float (or x 0)) (* (float (or origin-x 0.0)) (float (or scale-x 1.0)))) y (float (or y 0)) width (float (or width (.getRegionWidth object))) height (float (or height (.getRegionHeight object)))] + + (if (or scale-x scale-y angle) (let [scale-x (float (or scale-x 1)) scale-y (float (or scale-y 1)) origin-x (float (or origin-x (/ width 2))) origin-y (float (or origin-y (/ height 2))) angle (float (or angle 0))] - (.draw ^Batch batch object x y origin-x origin-y width height + (.draw ^Batch batch object x y (* origin-x scale-x) (* origin-y scale-y) width height scale-x scale-y angle)) (.draw ^Batch batch object x y width height)))))