resizing is well on its way to working.

This commit is contained in:
2015-02-21 01:18:07 -08:00
parent 843fde014d
commit 6419638b5e
10 changed files with 165 additions and 93 deletions

View File

@@ -39,7 +39,8 @@
(defscreen safe-screen
:on-show
(fn [screen entities]
(update! screen :renderer (stage) :camera (orthographic))
(utils/setup-viewport screen 320 240)
(let [inputed-key (texture "inside-house/inputed-key.png")]
{:fade (assoc (texture "black.png")
:scale-x 80
@@ -79,7 +80,7 @@
:on-touch-up (fn [screen [entities]]
(when (:shown? entities)
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
(let [[x y] (utils/unproject screen)]
(if-let [button (get-button [x y])]
(do (sound! (:sound button) :play)
(let [new-state (update-in entities [:button-choices] #(conj % (:id button)))]
@@ -103,6 +104,7 @@
(< y start-y)
(> y (+ start-y 75)))
(close entities))))))
:on-resize (fn [{:keys [width height viewport]} entities]
(.update viewport width height)))
:on-resize (fn [screen entities]
(size! screen 320 240)))