Phaser API Documentation

  Version: 

Member of: Phaser.Math

<static> Within(a, b, tolerance)

Description:

Checks if the two values are within the given tolerance of each other.

Parameters:

name type description
a number

The first value to use in the calculation.

b number

The second value to use in the calculation.

tolerance number

The tolerance. Anything equal to or less than this value is considered as being within range.

Returns:
Description:

Returns true if a is less than or equal to the tolerance of b.

Type:
  • boolean
Examples:
Since: 3.0.0
Source: src/math/Within.js (Line 7)