Matter.Mouse
Defined in: src/core/Mouse.js:1
The Matter.Mouse
module contains methods for creating and manipulating mouse inputs.
Methods
Matter.Mouse._getRelativeMousePosition
(event, element, pixelRatio)
→ private
Gets the mouse position relative to an element given a screen pixel ratio.
Parameters
event
Object
element
Object
pixelRatio
Number
Returns
Matter.Mouse.clearSourceEvents
(mouse)
Clears all captured source events.
Parameters
mouse
Mouse
Matter.Mouse.create
()→ Metricsprivate
Creates a new metrics.
Returns
MetricsA new metrics
Matter.Mouse.create
(element)
→ Mouse
Creates a mouse input.
Parameters
element
HTMLElement
Returns
MouseA new mouse
Matter.Mouse.reset
(metrics)
private
Resets metrics.
Parameters
metrics
Metrics
Matter.Mouse.setElement
(mouse, element)
Sets the element the mouse is bound to (and relative to).
Parameters
mouse
Mouse
element
HTMLElement
Matter.Mouse.setOffset
(mouse, offset)
Sets the mouse position offset.
Parameters
mouse
Mouse
offset
Vector
Matter.Mouse.setScale
(mouse, scale)
Sets the mouse position scale.
Parameters
mouse
Mouse
scale
Vector
Matter.Mouse.update
(metrics, engine)
private
Updates metrics.
Parameters
metrics
Metrics
engine
Engine