Phaser API Documentation

  Version: 
<readonly> distance: number

Description:

The distance the Pointer has moved, based on its previous and current position.

This value is smoothed out each frame, according to the motionFactor property.

This property is updated whenever the Pointer moves, regardless of any button states. In other words, it changes based on movement alone - a button doesn't have to be pressed first.

If you need the total distance travelled since the primary buttons was pressed down, then use the Pointer.getDistance method.

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