API Docs for: 1.4.3
Show:

PolyK.InteractionManager Class

The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive This manager also supports multitouch.

Constructor

PolyK.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 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

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

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

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 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

updates the state of interactive objects

Properties

mouse

InteractionData

the mouse data

stage

Stage

a reference to the stage

touchs

Object

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