more progress on ui scaling.
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
(.addListener ^Actor object listener))
|
||||
entity)
|
||||
|
||||
|
||||
(def ui-scale 1.75)
|
||||
(def mobile? (= 1.75 ui-scale))
|
||||
|
||||
(defn clear-stage [{:keys [^Stage renderer]}]
|
||||
(.clear renderer))
|
||||
|
||||
@@ -399,9 +403,16 @@
|
||||
(vals tweens)))
|
||||
|
||||
(defn intersects? [e [x y]]
|
||||
(and (:object e)
|
||||
(< (:x e) x (+ (:x e) (or (:width e) (when (actor? e) (.getWidth ^Actor (:object e))))))
|
||||
(< (:y e) y (+ (:y e) (or (:height e) (when (actor? e) (.getHeight ^Actor (:object e))))))))
|
||||
(when (:object e)
|
||||
(let [object-x (or (:x e) (when (actor? e ) (.getX ^Actor (:object e))) 0)
|
||||
object-y (or (:y e) (when (actor? e ) (.getY ^Actor (:object e))) 0)
|
||||
object-width (or (:width e) (when (actor? e ) (.getWidth ^Actor (:object e))) 0)
|
||||
object-height (or (:height e) (when (actor? e ) (.getHeight ^Actor (:object e))) 0)]
|
||||
(println object-x object-y object-width object-height)
|
||||
|
||||
(and (:object e)
|
||||
(< object-x x (+ object-x object-width))
|
||||
(< object-y y (+ object-y object-height))))))
|
||||
|
||||
(defn get-current-music [entities]
|
||||
(let [time (get-in entities [:state :time])
|
||||
|
||||
Reference in New Issue
Block a user