Set a texture entity's x and y when it is first created

This commit is contained in:
oakes
2014-01-19 15:56:06 -05:00
parent 9eba3bb28a
commit ebdb097462
2 changed files with 3 additions and 2 deletions

View File

@@ -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)))

View File

@@ -140,6 +140,8 @@
[^TextureRegion obj]
{:type :texture
:object obj
:x 0
:y 0
:width (.getRegionWidth obj)
:height (.getRegionHeight obj)})