more tweaks for wizard.

This commit is contained in:
2014-12-17 17:31:09 -08:00
parent 5432273f57
commit c1eab513b1
2 changed files with 11 additions and 3 deletions

View File

@@ -4,10 +4,10 @@
(defn make-entity [id entity]
(merge entity
{:mouse-in? (fn [entities x y]
(let [{entity-x :x entity-y :y width :width height :height region :object} (get-in entities [:room :entities id])
(let [{entity-x :x entity-y :y width :width scale-x :scale-x scale-y :scale-y height :height region :object} (get-in entities [:room :entities id])
width (or width (.getRegionWidth region))
height (or height (.getRegionHeight region))]
((zone/box entity-x entity-y (+ entity-x width) (+ entity-y height)) x y)))}
((zone/box entity-x entity-y (+ entity-x (* width (or 1 scale-x))) (+ entity-y (* height (or scale-y 1)))) x y)))}
(when (:script entity)
{:get-script (fn [cursor [x y]]
(if (= :main cursor)