Phaser API Documentation

  Version: 
setPosition(x, [y])

Description:

Set the position of the Camera viewport within the game.

This does not change where the camera is 'looking'. See setScroll to control that.

Parameters:

name type arguments Default description
x number

The top-left x coordinate of the Camera viewport.

y number <optional> x

The top-left y coordinate of the Camera viewport.

Returns:
Description:

This Camera instance.

Since: 3.0.0