Skip to content

Mouse wheel

Introduction

Mouse wheel events of phaser.

  • Author: Richard Davey

Usage

Mouse wheel events

  1. Events on touched Game object
    gameObject.on('wheel', function(pointer, dx, dy, dz, event){ /* ... */ });
    
  2. Event on input plugin for each touched Game object
    scene.input.on('gameobjectwheel', function(pointer, gameObject, dx, dy, dz, event){ /* ... */ });
    
  3. Events to get all touched Game Objects
    scene.input.on('wheel', function(pointer, currentlyOver, dx, dy, dz, event){ /* ... */ });
    

Mouse wheel properties

  • pointer.deltaX : The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.
  • pointer.deltaY : The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device.
  • pointer.deltaZ : The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.