#

API Docs for: 2.0.0
Show: Inherited Protected Private Deprecated

# InteractionManager Class

Defined in: `src/pixi/InteractionManager.js:5`
Module: PIXI

The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive if its interactive parameter is set to true This manager also supports multitouch.

## Constructor

### `InteractionManager`

(

- `stage`

)

Defined in `src/pixi/InteractionManager.js:5`

#### Parameters:

- `stage` Stage

  The stage to handle interactions

- Index
- Methods
- Properties

## Item Index

### Methods

- collectInteractiveSprite
- hitTest
- onMouseDown
- onMouseMove
- onMouseOut
- onMouseUp
- onTouchEnd
- onTouchMove
- onTouchStart
- rebuildInteractiveGraph
- removeEvents
- setTarget
- setTargetDomElement
- update

### Properties

- currentCursorStyle
- interactionDOMElement
- interactiveItems
- last
- mouse
- mouseOut
- mouseoverEnabled
- onMouseDown
- onMouseMove
- onMouseOut
- onMouseUp
- onTouchEnd
- onTouchMove
- onTouchStart
- pool
- resolution
- stage
- tempPoint
- touches

## Methods

### `collectInteractiveSprite`

(

- `displayObject`
- `iParent`

)
private

Defined in `src/pixi/InteractionManager.js:152`

Collects an interactive sprite recursively to have their interactions managed

#### Parameters:

- `displayObject` DisplayObject

  the displayObject to collect

- `iParent` DisplayObject

  the display object's parent

### `hitTest`

(

- `item`
- `interactionData`

)
private

Defined in `src/pixi/InteractionManager.js:586`

Tests if the current mouse coordinates hit a sprite

#### Parameters:

- `item` DisplayObject

  The displayObject to test for a hit

- `interactionData` InteractionData

  The interactionData object to update in the case there is a hit

### `onMouseDown`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:416`

Is called when the mouse button is pressed down on the renderer element

#### Parameters:

- `event` Event

  The DOM event of a mouse button being pressed down

### `onMouseMove`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:380`

Is called when the mouse moves across the renderer element

#### Parameters:

- `event` Event

  The DOM event of the mouse moving

### `onMouseOut`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:477`

Is called when the mouse is moved out of the renderer element

#### Parameters:

- `event` Event

  The DOM event of a mouse being moved out

### `onMouseUp`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:518`

Is called when the mouse button is released on the renderer element

#### Parameters:

- `event` Event

  The DOM event of a mouse button being released

### `onTouchEnd`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:798`

Is called when a touch is ended on the renderer element

#### Parameters:

- `event` Event

  The DOM event of a touch ending on the renderer view

### `onTouchMove`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:683`

Is called when a touch is moved across the renderer element

#### Parameters:

- `event` Event

  The DOM event of a touch moving across the renderer view

### `onTouchStart`

(

- `event`

)
private

Defined in `src/pixi/InteractionManager.js:729`

Is called when a touch is started on the renderer element

#### Parameters:

- `event` Event

  The DOM event of a touch starting on the renderer view

### `rebuildInteractiveGraph`

() private

Defined in `src/pixi/InteractionManager.js:355`

### `removeEvents`

() private

Defined in `src/pixi/InteractionManager.js:245`

### `setTarget`

(

- `target`

)
private

Defined in `src/pixi/InteractionManager.js:193`

Sets the target for event delegation

#### Parameters:

- `target` WebGLRenderer | CanvasRenderer

  the renderer to bind events to

### `setTargetDomElement`

(

- `domElement`

)
private

Defined in `src/pixi/InteractionManager.js:211`

Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element to receive those events

#### Parameters:

- `domElement` DOMElement

  the DOM element which will receive mouse and touch events

### `update`

() private

Defined in `src/pixi/InteractionManager.js:270`

updates the state of interactive objects

## Properties

### `currentCursorStyle`

String

Defined in `src/pixi/InteractionManager.js:128`

The css style of the cursor that is being used

### `interactionDOMElement`

HTMLCanvasElement private

Defined in `src/pixi/InteractionManager.js:70`

Our canvas

### `interactiveItems`

Array private

Defined in `src/pixi/InteractionManager.js:62`

An array containing all the iterative items from the our interactive tree

### `last`

Number

Defined in `src/pixi/InteractionManager.js:122`

### `mouse`

InteractionData

Defined in `src/pixi/InteractionManager.js:24`

The mouse data

### `mouseOut`

Boolean

Defined in `src/pixi/InteractionManager.js:135`

Is set to true when the mouse is moved out of the canvas

### `mouseoverEnabled`

Boolean

Defined in `src/pixi/InteractionManager.js:47`

### `onMouseDown`

Function

Defined in `src/pixi/InteractionManager.js:86`

### `onMouseMove`

Function

Defined in `src/pixi/InteractionManager.js:80`

### `onMouseOut`

Function

Defined in `src/pixi/InteractionManager.js:92`

### `onMouseUp`

Function

Defined in `src/pixi/InteractionManager.js:98`

### `onTouchEnd`

Function

Defined in `src/pixi/InteractionManager.js:110`

### `onTouchMove`

Function

Defined in `src/pixi/InteractionManager.js:116`

### `onTouchStart`

Function

Defined in `src/pixi/InteractionManager.js:104`

### `pool`

Array

Defined in `src/pixi/InteractionManager.js:54`

Tiny little interactiveData pool !

### `resolution`

Number

Defined in `src/pixi/InteractionManager.js:142`

### `stage`

Stage

Defined in `src/pixi/InteractionManager.js:16`

A reference to the stage

### `tempPoint`

Point private

Defined in `src/pixi/InteractionManager.js:40`

### `touches`

Object

Defined in `src/pixi/InteractionManager.js:32`

An object that stores current touches (InteractionData) by id reference