#

API Docs for: 1.4.3
Show: Inherited Protected Private Deprecated

# PolyK.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 This manager also supports multitouch.

## Constructor

### `PolyK.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
- onMouseUp
- onTouchEnd
- onTouchMove
- onTouchStart
- setTarget
- setTargetDomElement
- update

### Properties

- mouse
- stage
- touchs

## Methods

### `collectInteractiveSprite`

(

- `displayObject`
- `iParent`

)
private

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

Collects an interactive sprite recursively to have their interactions managed

#### Parameters:

- `displayObject` DisplayObject

  the displayObject to collect

- `iParent` DisplayObject

### `hitTest`

(

- `item`
- `interactionData`

)
private

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

Tests if the current mouse coords hit a sprite

#### Parameters:

- `item` DisplayObject

  The displayObject to test for a hit

- `interactionData` InteractionData

  The interactionData object to update in the case of a hit

### `onMouseDown`

(

- `event`

)
private

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

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:277`

Is called when the mouse moves across the renderer element

#### Parameters:

- `event` Event

  The DOM event of the mouse moving

### `onMouseUp`

(

- `event`

)
private

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

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:588`

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:495`

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:533`

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

### `setTarget`

(

- `target`

)
private

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

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:131`

Sets the dom element which will receive mouse/touch events. This is useful for when you have other DOM elements ontop 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:180`

updates the state of interactive objects

## Properties

### `mouse`

InteractionData

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

the mouse data

### `stage`

Stage

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

a reference to the stage

### `touchs`

Object

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

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