Jump to content

Mouse wheel not working


monoloco
 Share

Recommended Posts

Hi there,

 

I know that this topic is half-covered: 

http://www.html5gamedevs.com/topic/7658-dealing-with-mouse-wheel/?hl=mousewheel#entry45755

 

But I'm not getting it to work, I tried every event of the mouse class, but the wheel is just not working, this is my code:

 

on the onCrete method:

 

myGame.input.mouse.mouseWheelCallback = function(event){                console.log("Scroll by callback! " + event);                if (!(event.wheelDeltaY == undefined || event.wheelDeltaY> myGame.world.height || event.wheelDeltaY < (-myGame.world.height))) {                    myGame.camera.setPosition(0, myGame.camera.y - event.wheelDeltaY);                };            };
It does not even log.
The idea is to make a candy crash scroll map.
I tried it both on my laptop's trackpad and on a PC with real mouse wheel.
 
Every help is much appreciated. 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...