Fix camera behavior
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user