Phaser API Documentation

  Version: 
getDistanceX()

Description:

If the Pointer has a button pressed down at the time this method is called, it will return the horizontal 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 horizontal distance, based on where the Pointer was when the button was released.

Returns:
Description:

The horizontal distance the Pointer moved.

Type:
  • number
Since: 3.16.0
Source: src/input/Pointer.js (Line 1048)