Set a texture entity's x and y when it is first created
This commit is contained in:
@@ -159,8 +159,7 @@
|
|||||||
(.draw object batch 1))
|
(.draw object batch 1))
|
||||||
|
|
||||||
(defmethod draw-entity! :texture
|
(defmethod draw-entity! :texture
|
||||||
[^SpriteBatch batch {:keys [^TextureRegion object x y width height]
|
[^SpriteBatch batch {:keys [^TextureRegion object x y width height]}]
|
||||||
:or {x 0 y 0}}]
|
|
||||||
(assert object)
|
(assert object)
|
||||||
(.draw batch object (float x) (float y) (float width) (float height)))
|
(.draw batch object (float x) (float y) (float width) (float height)))
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,8 @@
|
|||||||
[^TextureRegion obj]
|
[^TextureRegion obj]
|
||||||
{:type :texture
|
{:type :texture
|
||||||
:object obj
|
:object obj
|
||||||
|
:x 0
|
||||||
|
:y 0
|
||||||
:width (.getRegionWidth obj)
|
:width (.getRegionWidth obj)
|
||||||
:height (.getRegionHeight obj)})
|
:height (.getRegionHeight obj)})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user