API Docs for: 2.0.0
Show:

InteractionManager Class

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
)

Parameters:

  • stage Stage

    The stage to handle interactions

Methods

collectInteractiveSprite

(
  • displayObject
  • iParent
)
private

Collects an interactive sprite recursively to have their interactions managed

Parameters:

hitTest

(
  • item
  • interactionData
)
private

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

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

Is called when the mouse moves across the renderer element

Parameters:

  • event Event

    The DOM event of the mouse moving

onMouseOut

(
  • event
)
private

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

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

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

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

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

removeEvents

() private

setTarget

(
  • target
)
private

Sets the target for event delegation

Parameters:

setTargetDomElement

(
  • domElement
)
private

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

updates the state of interactive objects

Properties

currentCursorStyle

String

The css style of the cursor that is being used

interactionDOMElement

HTMLCanvasElement private

Our canvas

interactiveItems

Array private

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

last

Number

mouse

InteractionData

The mouse data

mouseOut

Boolean

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

mouseoverEnabled

Boolean

onMouseDown

Function

onMouseMove

Function

onMouseOut

Function

onMouseUp

Function

onTouchEnd

Function

onTouchMove

Function

onTouchStart

Function

pool

Array

Tiny little interactiveData pool !

resolution

Number

stage

Stage

A reference to the stage

tempPoint

Point private

touches

Object

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