monoloco Posted July 13, 2014 Share Posted July 13, 2014 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 More sharing options...
Recommended Posts