Show:
API

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)
Object 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

(element)
Mouse

Creates a mouse input.

Parameters

Returns

Mouse

A new mouse

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