From 7c4f8f723c9cbc06bac46e85ad15f5d70ec4bf60 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 10 Sep 2014 14:29:32 -0700 Subject: [PATCH 1/2] hack for making centering work. --- src/play_clj/entities.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/play_clj/entities.clj b/src/play_clj/entities.clj index 268b5d9..86f92ac 100644 --- a/src/play_clj/entities.clj +++ b/src/play_clj/entities.clj @@ -24,7 +24,7 @@ scale-x scale-y angle origin-x origin-y]} _ batch] - (let [x (float (or x 0)) + (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)))] From 1d413a12a8acd0fcf95c7ef80fda74e9d1a0fd67 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Wed, 17 Sep 2014 12:29:20 -0700 Subject: [PATCH 2/2] making alpha work. --- src/play_clj/core_graphics.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index edb3195..87b531e 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -475,7 +475,9 @@ with the tiled map file at `path` and `unit` scale. (let [^Batch batch (.getBatch renderer)] (.begin batch) (doseq [entity entities] - (e/draw-entity! entity screen batch)) + (.setColor batch (color 1 1 1 (or (:opacity entity) 1.0))) + (e/draw-entity! entity screen batch) + (.setColor batch (color 1 1 1 1))) (.end batch)) entities)