Phaser API Documentation

  Version: 
clampX(x)

Description:

Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. Do not call this method if you are not using camera bounds.

Parameters:

name type description
x number

The value to horizontally scroll clamp.

Returns:
Description:

The adjusted value to use as scrollX.

Type:
  • number
Since: 3.11.0