Change resizing functions

This commit is contained in:
oakes
2014-01-12 15:00:23 -05:00
parent 6737654ba4
commit 87eb343e48

View File

@@ -97,12 +97,20 @@
[]
(PerspectiveCamera.))
(defn resize-camera!
(defn size!
[{:keys [^OrthographicCamera camera]} width height]
(assert camera)
(.setToOrtho camera false width height))
(defn move-camera!
(defn height!
[{:keys [width height] :as screen} new-height]
(size! screen (* new-height (/ width height)) new-height))
(defn width!
[{:keys [width height] :as screen} new-width]
(size! screen new-width (* new-width (/ height width))))
(defn move!
[{:keys [^Camera camera]} x y]
(assert camera)
(when x (set! (. (. camera position) x) x))