Phaser API Documentation

  Version: 
getDistance()

Description:

If the Pointer has a button pressed down at the time this method is called, it will return the distance between the Pointer's downX and downY values and the current position.

If no button is held down, it will return the last recorded distance, based on where the Pointer was when the button was released.

If you wish to get the distance being travelled currently, based on the velocity of the Pointer, then see the Pointer.distance property.

Returns:
Description:

The distance the Pointer moved.

Type:
  • number
Since: 3.13.0
Source: src/input/Pointer.js (Line 1021)