Phaser API Documentation

  Version: 
setScroll(x, [y])

Description:

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.

Parameters:

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.

Returns:
Description:

This Camera instance.

Since: 3.0.0