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
Members
-
autoPreventDefaultboolean
-
Should default browser actions automatically be prevented.
Does not apply to pointer events for backwards compatibility
preventDefault on pointer events stops mouse events from firing
Thus, for every pointer event, there will always be either a mouse of touch event alongside it.- Default Value:
- true
-
currentCursorModestring
-
The mode of the cursor that is being used.
The value of this is a key from the cursorStyles dictionary. -
currentCursorStylestring
-
- Deprecated
- since 4.3.0
- See:
-
cursorStylesObject.<string, (string|function()|Object.<string, string>)>
-
Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor
values, objects are handled as dictionaries of CSS values for interactionDOMElement,
and functions are called instead of changing the CSS.
Default CSS cursor values are provided for 'default' and 'pointer' modes. -
defaultCursorStylestring
-
- Deprecated
- since 4.3.0
- See:
-
eventDataobject
-
An event data object to handle all the event tracking/dispatching
-
interactionFrequencynumber
-
Frequency in milliseconds that the mousemove, moveover & mouseout interaction events will be checked.
- Default Value:
- 10
-
The mouse data
-
moveWhenInsideboolean
-
This property determines if mousemove and touchmove events are fired only when the cursor
is over the object.
Setting to true will make things work more in line with how the DOM verison works.
Setting to false can make things easier for things like dragging
It is currently set to false as this is how pixi used to work. This will be set to true in
future versions of pixi.- Default Value:
- false
-
rendererPIXI.SystemRenderer
-
The renderer this interaction manager works for.
-
resolutionnumber
-
The current resolution / device pixel ratio.
- Default Value:
- 1
-
readonlysupportsPointerEventsboolean
-
Does the device support pointer events
https://www.w3.org/Submission/pointer-events/ -
readonlysupportsTouchEventsboolean
-
Does the device support touch events
https://www.w3.org/TR/touch-events/
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 point
PIXI.Point the point that the result will be stored in
x
number the x coord of the position to map
y
number the y coord of the position to map
-
setCursorMode(mode)
-
Sets the current cursor mode, handling any callbacks or CSS style changes.
Name Type Description mode
string cursor mode, a key from the cursorStyles dictionary
-
update(deltaTime)
-
Updates the state of interactive objects.
Invoked by a throttled ticker update from PIXI.ticker.shared.Name Type Description deltaTime
number time delta since last tick
Events
-
Fired when a pointer device button (usually a mouse button) is pressed and released on
the display object.Type:
-
mousedown
-
Fired when a pointer device button (usually a mouse button) is pressed on the display
object.Type:
-
mousemove
-
Fired when a pointer device (usually a mouse) is moved while over the display object
Type:
-
mouseout
-
Fired when a pointer device (usually a mouse) is moved off the display object
Type:
-
mouseover
-
Fired when a pointer device (usually a mouse) is moved onto the display object
Type:
-
Fired when a pointer device button (usually a mouse button) is released over the display
object.Type:
-
mouseupoutside
-
Fired when a pointer device button (usually a mouse button) is released outside the
display object that initially registered a
mousedown.Type:
-
pointercancel
-
Fired when the operating system cancels a pointer event
-
pointerdown
-
Fired when a pointer device button is pressed on the display object.
Type:
-
pointermove
-
Fired when a pointer device is moved while over the display object
Type:
-
pointerout
-
Fired when a pointer device is moved off the display object
Type:
-
pointerover
-
Fired when a pointer device is moved onto the display object
Type:
-
pointertap
-
Fired when a pointer device button is pressed and released on the display object.
Type:
-
pointerup
-
Fired when a pointer device button is released over the display object.
Type:
-
pointerupoutside
-
Fired when a pointer device button is released outside the display object that initially
registered a pointerdown.Type:
-
rightclick
-
Fired when a pointer device secondary button (usually a mouse right-button) is pressed
and released on the display object.Type:
-
rightdown
-
Fired when a pointer device secondary button (usually a mouse right-button) is pressed
on the display object.Type:
-
Fired when a pointer device secondary button (usually a mouse right-button) is released
over the display object.Type:
-
rightupoutside
-
Fired when a pointer device secondary button (usually a mouse right-button) is released
outside the display object that initially registered a
rightdown.Type:
-
Fired when a touch point is placed and removed from the display object.
Type:
-
touchcancel
-
Fired when the operating system cancels a touch
-
touchend
-
Fired when a touch point is removed from the display object.
Type:
-
touchendoutside
-
Fired when a touch point is removed outside of the display object that initially
registered a touchstart.Type:
-
touchmove
-
Fired when a touch point is moved along the display object.
Type:
-
touchstart
-
Fired when a touch point is placed on the display object.
Type: