Phaser API Documentation

  Version: 

Member of: Phaser.Math

<static> Clamp(value, min, max)

Description:

Force a value within the boundaries by clamping it to the range min, max.

Parameters:

name type description
value number

The value to be clamped.

min number

The minimum bounds.

max number

The maximum bounds.

Returns:
Description:

The clamped value.

Type:
  • number
Since: 3.0.0
Source: src/math/Clamp.js (Line 7)