Jump to content

Mouse wheel not working


Recommended Posts

Hi there,


I know that this topic is half-covered: 



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


  • Recently Browsing   0 members

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