From ebdb0974620258e6ea82968224728541b5ae2d74 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 19 Jan 2014 15:56:06 -0500 Subject: [PATCH] Set a texture entity's x and y when it is first created --- src/play_clj/core_graphics.clj | 3 +-- src/play_clj/utils.clj | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 7a5092a..32e8245 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -159,8 +159,7 @@ (.draw object batch 1)) (defmethod draw-entity! :texture - [^SpriteBatch batch {:keys [^TextureRegion object x y width height] - :or {x 0 y 0}}] + [^SpriteBatch batch {:keys [^TextureRegion object x y width height]}] (assert object) (.draw batch object (float x) (float y) (float width) (float height))) diff --git a/src/play_clj/utils.clj b/src/play_clj/utils.clj index e829455..73b8d36 100644 --- a/src/play_clj/utils.clj +++ b/src/play_clj/utils.clj @@ -140,6 +140,8 @@ [^TextureRegion obj] {:type :texture :object obj + :x 0 + :y 0 :width (.getRegionWidth obj) :height (.getRegionHeight obj)})