From fd16a41cce926f64e556c1e5ad9556dcf174b39a Mon Sep 17 00:00:00 2001 From: = Date: Wed, 10 Sep 2014 14:29:32 -0700 Subject: [PATCH] hack for making centering work. --- src/play_clj/entities.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/play_clj/entities.clj b/src/play_clj/entities.clj index e66a584..8c243c1 100644 --- a/src/play_clj/entities.clj +++ b/src/play_clj/entities.clj @@ -21,10 +21,10 @@ (defrecord TextureEntity [object] Entity (draw! [{:keys [^TextureRegion object x y width height - scale-x scale-y angle origin-x origin-y]} - _ - batch] - (let [x (float (or x 0)) + scale-x scale-y angle origin-x origin-y]} + _ + 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)))]