lots of ending improvements
This commit is contained in:
@@ -9,13 +9,14 @@
|
||||
(println "loading " *ns*)
|
||||
|
||||
(defn make-entity [id {:keys [scripts script only-script] :as entity}]
|
||||
|
||||
(merge entity
|
||||
{:id id
|
||||
:mouse-in? (fn [entities x y]
|
||||
(let [e (utils/get-entity entities id)]
|
||||
(if-let [[bx1 by1 bx2 by2] (:box e)]
|
||||
(zone/within bx1 by1 bx2 by2 x y)
|
||||
(let [{^float entity-x :x ^float entity-y :y width :width scale-x :scale-x scale-y :scale-y origin-x :origin-x origin-y :origin-y height :height region :object} (-> entities :room :entities id)
|
||||
(let [{^float entity-x :x ^float entity-y :y width :width scale-x :scale-x scale-y :scale-y origin-x :origin-x origin-y :origin-y height :height region :object} (-> entities :room :entities (get id))
|
||||
|
||||
width (or width (if (instance? TextureRegion region ) (.getRegionWidth ^TextureRegion region) 0))
|
||||
height (or height (if (instance? TextureRegion region ) (.getRegionHeight ^TextureRegion region) 0))
|
||||
|
||||
Reference in New Issue
Block a user