Namespace: Input

Phaser. Input

Classes

InputManager
InputPlugin
Pointer

Namespaces

Events
Gamepad
InputPluginCache
Keyboard
Mouse
Touch

Members


<static> MOUSE_DOWN :number

The mouse pointer is being held down.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 9)

<static> MOUSE_MOVE :number

The mouse pointer is being moved.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 18)

<static> MOUSE_UP :number

The mouse pointer is released.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 27)

<static> MOUSE_WHEEL :number

The mouse wheel changes.

Type:
  • number
Since: 3.18.0
Source: src/input/const.js (Line 81)

<static> POINTER_LOCK_CHANGE :number

The pointer lock has changed.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 63)

<static> TOUCH_CANCEL :number

A touch pointer has been been cancelled by the browser.

Type:
  • number
Since: 3.15.0
Source: src/input/const.js (Line 72)

<static> TOUCH_END :number

A touch pointer has been started.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 54)

<static> TOUCH_MOVE :number

A touch pointer has been started.

Type:
  • number
Since: 3.10.0
Source: src/input/const.js (Line 45)

<static> TOUCH_START :number

A touch pointer has been started.

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

Methods


<static> CreateInteractiveObject(gameObject, hitArea, hitAreaCallback)

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.

Since: 3.0.0
Source: src/input/CreateInteractiveObject.js (Line 7)
Returns:

The new Interactive Object.

Type
Phaser.Types.Input.InteractiveObject

<static> CreatePixelPerfectHandler(textureManager, alphaTolerance)

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.

Since: 3.10.0
Source: src/input/CreatePixelPerfectHandler.js (Line 7)
Returns:

The new Pixel Perfect Handler function.

Type
function