new PIXI.interaction.InteractionManager(renderer, options)
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
renderer |
PIXI.CanvasRenderer | PIXI.WebGLRenderer |
A reference to the current renderer |
||||||||||||
options |
object |
optional
The options for the manager.
|
Extends
- EventEmitter
Methods
-
destroy()
-
Destroys the interaction manager
-
mapPositionToPoint(point, x, y)
-
Maps x and y coords from a DOM object and maps them correctly to the pixi view. The
resulting value is stored in the point. This takes into account the fact that the DOM
element could be scaled and positioned anywhere on the screen.Name Type Description pointPIXI.Point the point that the result will be stored in
xnumber the x coord of the position to map
ynumber the y coord of the position to map
-
processInteractive(point, displayObject, func, hitTest, interactive){boolean}
-
This function is provides a neat way of crawling through the scene graph and running a
specified function on all interactive objects it finds. It will also take care of hit
testing the interactive objects and passes the hit across in the function.Name Type Description pointPIXI.Point the point that is tested for collision
displayObjectPIXI.Container | PIXI.Sprite | PIXI.extras.TilingSprite the displayObject
that will be hit test (recursively crawls its children)funcfunction optional the function that will be called on each interactive object. The
displayObject and hit will be passed to the functionhitTestboolean optional this indicates if the objects inside should be hit test against the point
interactiveboolean optional Whether the displayObject is interactive
Returns:
Type Description boolean returns true if the displayObject hit the point -
update(deltaTime)
-
Updates the state of interactive objects.
Invoked by a throttled ticker update from PIXI.ticker.shared.Name Type Description deltaTimenumber time delta since last tick
Events
-
Fired when a pointer device button (usually a mouse button) is pressed and released on
the display object. -
mousedown
-
Fired when a pointer device button (usually a mouse button) is pressed on the display
object. -
mousemove
-
Fired when a pointer device (usually a mouse) is moved while over the display object
-
mouseout
-
Fired when a pointer device (usually a mouse) is moved off the display object
-
mouseover
-
Fired when a pointer device (usually a mouse) is moved onto the display object
-
Fired when a pointer device button (usually a mouse button) is released over the display
object. -
mouseupoutside
-
Fired when a pointer device button (usually a mouse button) is released outside the
display object that initially registered a
mousedown. -
pointerdown
-
Fired when a pointer device button is pressed on the display object.
-
pointermove
-
Fired when a pointer device is moved while over the display object
-
pointerout
-
Fired when a pointer device is moved off the display object
-
pointerover
-
Fired when a pointer device is moved onto the display object
-
pointertap
-
Fired when a pointer device button is pressed and released on the display object.
-
pointerup
-
Fired when a pointer device button is released over the display object.
-
pointerupoutside
-
Fired when a pointer device button is released outside the display object that initially
registered a pointerdown. -
rightclick
-
Fired when a pointer device secondary button (usually a mouse right-button) is pressed
and released on the display object. -
rightdown
-
Fired when a pointer device secondary button (usually a mouse right-button) is pressed
on the display object. -
Fired when a pointer device secondary button (usually a mouse right-button) is released
over the display object. -
rightupoutside
-
Fired when a pointer device secondary button (usually a mouse right-button) is released
outside the display object that initially registered a
rightdown. -
Fired when a touch point is placed and removed from the display object.
-
touchend
-
Fired when a touch point is removed from the display object.
-
touchendoutside
-
Fired when a touch point is removed outside of the display object that initially
registered a touchstart. -
touchmove
-
Fired when a touch point is moved along the display object.
-
touchstart
-
Fired when a touch point is placed on the display object.