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

Returns

@ src/core/Mouse.js:170

Matter.Mouse.clearSourceEvents

(mouse)

Clears all captured source events.

Parameters

@ src/core/Mouse.js:131

Matter.Mouse.create

()→ Metricsprivate

Creates a new metrics.

Returns

MetricsA new metrics

@ src/core/Metrics.js:16

Matter.Mouse.create

(element)

Mouse

Creates a mouse input.

Parameters

Returns

MouseA new mouse

@ src/core/Mouse.js:15

Matter.Mouse.reset

(metrics)

private

Resets metrics.

Parameters

  • metrics Metrics

@ src/core/Metrics.js:43

Matter.Mouse.setElement

(mouse, element)

Sets the element the mouse is bound to (and relative to).

Parameters

@ src/core/Mouse.js:110

Matter.Mouse.setOffset

(mouse, offset)

Sets the mouse position offset.

Parameters

@ src/core/Mouse.js:144

Matter.Mouse.setScale

(mouse, scale)

Sets the mouse position scale.

Parameters

@ src/core/Mouse.js:157

Matter.Mouse.update

(metrics, engine)

private

Updates metrics.

Parameters

  • metrics Metrics

@ src/core/Metrics.js:67

Item Index

Methods