From f582f18392d1da0b483617ccec98be991322cc59 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 19 Jan 2014 17:00:07 -0500 Subject: [PATCH] Don't set default x and y values, and change some key names --- src/play_clj/core_graphics.clj | 3 ++- src/play_clj/core_listeners.clj | 8 ++++---- src/play_clj/utils.clj | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 32e8245..7a5092a 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -159,7 +159,8 @@ (.draw object batch 1)) (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) (.draw batch object (float x) (float y) (float width) (float height))) diff --git a/src/play_clj/core_listeners.clj b/src/play_clj/core_listeners.clj index 48533fc..53f37c3 100644 --- a/src/play_clj/core_listeners.clj +++ b/src/play_clj/core_listeners.clj @@ -17,19 +17,19 @@ (execute-fn! on-key-up :keycode k) false) (mouseMoved [this sx sy] - (execute-fn! on-mouse-moved :screen-x sx :screen-y sy) + (execute-fn! on-mouse-moved :x sx :y sy) false) (scrolled [this a] (execute-fn! on-scrolled :amount a) false) (touchDown [this sx sy p b] - (execute-fn! on-touch-down :screen-x sx :screen-y sy :pointer p :button b) + (execute-fn! on-touch-down :x sx :y sy :pointer p :button b) false) (touchDragged [this sx sy p] - (execute-fn! on-touch-dragged :screen-x sx :screen-y sy :pointer p) + (execute-fn! on-touch-dragged :x sx :y sy :pointer p) false) (touchUp [this sx sy p b] - (execute-fn! on-touch-up :screen-x sx :screen-y sy :pointer p :button b) + (execute-fn! on-touch-up :x sx :y sy :pointer p :button b) false))) (defn ^:private gesture-listener diff --git a/src/play_clj/utils.clj b/src/play_clj/utils.clj index 73b8d36..e829455 100644 --- a/src/play_clj/utils.clj +++ b/src/play_clj/utils.clj @@ -140,8 +140,6 @@ [^TextureRegion obj] {:type :texture :object obj - :x 0 - :y 0 :width (.getRegionWidth obj) :height (.getRegionHeight obj)})