Phaser API Documentation

  Version: 
<static> GetMinMaxValue(source, key, min, max, defaultValue)

Description:

Retrieves and clamps a numerical value from an object.

Parameters:

name type description
source object

The object to retrieve the value from.

key string

The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (.).

min number

The minimum value which can be returned.

max number

The maximum value which can be returned.

defaultValue number

The value to return if the property doesn't exist. It's also constrained to the given bounds.

Returns:
Description:

The clamped value from the source object.

Type:
  • number
Since: 3.0.0