Set the position of where the Camera is looking within the game.
You can also modify the properties Camera.scrollX
and Camera.scrollY
directly.
Use this method, or the scroll properties, to move your camera around the game world.
This does not change where the camera viewport is placed. See setPosition
to control that.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The x coordinate of the Camera in the game world. |
||
y | number | <optional> | x |
The y coordinate of the Camera in the game world. |
This Camera instance.