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
Item Index
Methods
Methods
collectInteractiveSprite
-
displayObject
-
iParent
Collects an interactive sprite recursively to have their interactions managed
Parameters:
-
displayObject
DisplayObjectthe displayObject to collect
-
iParent
DisplayObjectthe display object's parent
hitTest
-
item
-
interactionData
Tests if the current mouse coordinates hit a sprite
Parameters:
-
item
DisplayObjectThe displayObject to test for a hit
-
interactionData
InteractionDataThe interactionData object to update in the case there is a hit
onMouseDown
-
event
Is called when the mouse button is pressed down on the renderer element
Parameters:
-
event
EventThe DOM event of a mouse button being pressed down
onMouseMove
-
event
Is called when the mouse moves across the renderer element
Parameters:
-
event
EventThe DOM event of the mouse moving
onMouseOut
-
event
Is called when the mouse button is moved out of the renderer element
Parameters:
-
event
EventThe DOM event of a mouse button being moved out
onMouseUp
-
event
Is called when the mouse button is released on the renderer element
Parameters:
-
event
EventThe DOM event of a mouse button being released
onTouchEnd
-
event
Is called when a touch is ended on the renderer element
Parameters:
-
event
EventThe DOM event of a touch ending on the renderer view
onTouchMove
-
event
Is called when a touch is moved across the renderer element
Parameters:
-
event
EventThe DOM event of a touch moving across the renderer view
onTouchStart
-
event
Is called when a touch is started on the renderer element
Parameters:
-
event
EventThe DOM event of a touch starting on the renderer view
setTarget
-
target
Sets the target for event delegation
Parameters:
-
target
WebGLRenderer | CanvasRendererthe renderer to bind events to
setTargetDomElement
-
domElement
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
DOMElementthe 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
mouseOut
Boolean
Is set to true when the mouse is moved out of the canvas
mouseoverEnabled
Boolean
pool
Array
tiny little interactiveData pool !
touchs
Object
an object that stores current touches (InteractionData) by id reference