Fix camera behavior

This commit is contained in:
oakes
2014-04-07 11:26:10 -04:00
parent 8d0502560a
commit 6a3bbf07b6
2 changed files with 6 additions and 5 deletions

View File

@@ -39,15 +39,13 @@
(u/call! object# ~k ~@options)))
(defn size!
"Sets the size of the camera in `screen` and recenters it.
"Sets the size of the camera in `screen`.
(size! screen 480 360)"
[screen width height]
(let [^Camera camera (u/get-obj screen :camera)]
(set! (. camera viewportWidth) width)
(set! (. camera viewportHeight) height)
(set! (. (. camera position) x) (/ width 2))
(set! (. (. camera position) y) (/ height 2))
(.update camera)))
(defn width