Show:

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

Matter.Mouse.clearSourceEvents

(mouse)

Clears all captured source events.

Parameters

Matter.Mouse.create

()
→ Metrics private

Creates a new metrics.

Returns

Metrics

A new metrics

Matter.Mouse.create

(element)
Mouse

Creates a mouse input.

Parameters

Returns

Mouse

A 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

Matter.Mouse.setOffset

(mouse, offset)

Sets the mouse position offset.

Parameters

Matter.Mouse.setScale

(mouse, scale)

Sets the mouse position scale.

Parameters

Matter.Mouse.update

(metrics, engine)
private

Updates metrics.

Parameters

  • metrics Metrics
  • engine Engine
0.11.0