Skip to main content
MouseState = object
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:12 Snapshot of mouse cursor state for the current frame.

Remarks

Returned by InputLibrary.getMouseState. deltaX / deltaY are reset to 0 at the beginning of each frame. Positions are in game coordinates (the viewport’s design resolution); without a viewport they are CSS pixels relative to the container.

Properties

deltaX

deltaX: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:22 Horizontal movement since the previous frame.

deltaY

deltaY: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:24 Vertical movement since the previous frame.

focus

focus: boolean
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:26 true while the cursor is inside the game window.

prevX

prevX: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:18 Horizontal cursor position from the previous frame.

prevY

prevY: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:20 Vertical cursor position from the previous frame.

x

x: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:14 Current horizontal cursor position, in game coordinates.

y

y: number
Defined in: modules/input/src/keyboard-mouse/mouse.types.ts:16 Current vertical cursor position, in game coordinates.