polo Posted July 7, 2014 Share Posted July 7, 2014 Dear any ideas how can i do to dealing with the mouse wheel ? I want to do a kind of zoom in-out effect...Regards Link to comment Share on other sites More sharing options...
lewster32 Posted July 7, 2014 Share Posted July 7, 2014 Phaser itself doesn't have any abstractions to deal with the mousewheel (since its focus is on cross-device) but you can use the standard browser events. Here's a link that will help with cross-browser handling: https://developer.mozilla.org/en-US/docs/Web/Events/wheel#Listening_to_this_event_across_browser Link to comment Share on other sites More sharing options...
wayfinder Posted July 7, 2014 Share Posted July 7, 2014 There's code in the dev branch that will handle mouse wheel input. Link to comment Share on other sites More sharing options...
lewster32 Posted July 7, 2014 Share Posted July 7, 2014 Ah, I didn't notice this - so it does! I retract my previous statement Link to comment Share on other sites More sharing options...
CtlAltDel Posted July 7, 2014 Share Posted July 7, 2014 game.input.mouse.mouseWheelCallback = mouseWheel;function mouseWheel(event) { console.log(game.input.mouse.wheelDelta);}And there are 2 constants as well: Phaser.Mouse.WHEEL_UP and Phaser.Mouse.WHEEL_DOWN. The wheelDelta will contain either of those values depending on the direction of the wheelscroll. liakos1992 and Phaser911 2 Link to comment Share on other sites More sharing options...
polo Posted July 8, 2014 Author Share Posted July 8, 2014 Perfect Thanks Link to comment Share on other sites More sharing options...
Recommended Posts