Class: MouseWheel

Phaser. MouseWheel

new MouseWheel(game)

The mouse wheel input handler.

Parameters:
Name Type Description
game Phaser.Game
Source:
src/input/MouseWheel.js line 7

Members

<static, constant> DOWN : number

Type:
  • number
Source:
src/input/MouseWheel.js line 103

<static, constant> UP : number

Type:
  • number
Source:
src/input/MouseWheel.js line 97

<readonly> active : boolean

Whether the handler is active.

Type:
  • boolean
Source:
src/input/MouseWheel.js line 41
See:

callback : function

A callback to call for each wheel event. It receives an event parameter.

Type:
  • function
Source:
src/input/MouseWheel.js line 48

callbackContext : any

The context for Phaser.MouseWheel#callback. The default is Phaser.MouseWheel#game.

Type:
  • any
Source:
src/input/MouseWheel.js line 55

<readonly> delta : number

The direction of the last wheel event. Between -1 (down) and 1 (up).

Type:
  • number
Source:
src/input/MouseWheel.js line 64

element : HTMLElement

The element where event listeners are added (the game canvas).

Type:
  • HTMLElement
Source:
src/input/MouseWheel.js line 25

game : Phaser.Game

The currently running game.

Type:
Source:
src/input/MouseWheel.js line 13

input : Phaser.Input

The Input Manager.

Type:
Source:
src/input/MouseWheel.js line 19

preventDefault : boolean

Whether the default mouse wheel actions (usually zoom or pan) are cancelled.

Type:
  • boolean
Default Value:
  • true
Source:
src/input/MouseWheel.js line 32

Methods

start()

Activates the handler, unless unsupported or already activate.

Source:
src/input/MouseWheel.js line 105
Returns:
  • True if the handler was started, otherwise false.
Type
boolean

stop()

Deactivates the handler.

Source:
src/input/MouseWheel.js line 133

phaser-ce@2.20.1 is on GitHub and NPM

Documentation generated by JSDoc 3.6.11 on 2024-10-05 using Tomorrow.