Phaser API Documentation

  Version: 
centerOnX(x)

Description:

Moves the Camera horizontally so that it is centered on the given x coordinate, bounds allowing. Calling this does not change the scrollY value.

Parameters:

name type description
x number

The horizontal coordinate to center on.

Returns:
Description:

This Camera instance.

Since: 3.16.0