Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Input
Phaser.Input
Source: src/input/index.js (Line 10)

Classes

Namespace

Members

<static> MOUSE_DOWN: number
Focus
Focus

Description:

The mouse pointer is being held down.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 9)
Focus
Focus
<static> MOUSE_MOVE: number
Focus
Focus

Description:

The mouse pointer is being moved.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 18)
Focus
Focus
<static> MOUSE_UP: number
Focus
Focus

Description:

The mouse pointer is released.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 27)
Focus
Focus
<static> MOUSE_WHEEL: number
Focus
Focus

Description:

The mouse wheel changes.

Type:
number
Since: 3.18.0
Source: src/input/const.js (Line 81)
Focus
Focus
<static> POINTER_LOCK_CHANGE: number
Focus
Focus

Description:

The pointer lock has changed.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 63)
Focus
Focus
<static> TOUCH_CANCEL: number
Focus
Focus

Description:

A touch pointer has been been cancelled by the browser.

Type:
number
Since: 3.15.0
Source: src/input/const.js (Line 72)
Focus
Focus
<static> TOUCH_END: number
Focus
Focus

Description:

A touch pointer has been started.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 54)
Focus
Focus
<static> TOUCH_MOVE: number
Focus
Focus

Description:

A touch pointer has been started.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 45)
Focus
Focus
<static> TOUCH_START: number
Focus
Focus

Description:

A touch pointer has been started.

Type:
number
Since: 3.10.0
Source: src/input/const.js (Line 36)
Focus
Focus

Methods

<static> CreateInteractiveObject(gameObject, hitArea, hitAreaCallback)
Focus
Focus

Description:

Creates a new Interactive Object.

This is called automatically by the Input Manager when you enable a Game Object for input.

The resulting Interactive Object is mapped to the Game Object's input property.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object to which this Interactive Object is bound.

hitArea any

The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle.

hitAreaCallback Phaser.Types.Input.HitAreaCallback

The 'contains' check callback that the hit area shape will use for all hit tests.

Returns:
Description:

The new Interactive Object.

Examples:
Since: 3.0.0
Focus
Focus
<static> CreatePixelPerfectHandler(textureManager, alphaTolerance)
Focus
Focus

Description:

Creates a new Pixel Perfect Handler function.

Access via InputPlugin.makePixelPerfect rather than calling it directly.

Parameters:

name type description
textureManager Phaser.Textures.TextureManager

A reference to the Texture Manager.

alphaTolerance number

The alpha level that the pixel should be above to be included as a successful interaction.

Returns:
Description:

The new Pixel Perfect Handler function.

Type:
  • function
Examples:
Since: 3.10.0
Focus
Focus