mousewheel event issue

Recommended Posts

okay. I will be more descriptive with the title next time.!!!

I am using melonjs 4.1 . Tried in both firefox and chrome, I am using Windows 8.1


this is my code 

      me.input.registerPointerEvent("mousewheel",, function (event) {
           me.event.publish("mousewheel", [ event ]);
        this.mousewheel = me.event.subscribe("mousewheel", function (event) {

            var viewport =;
            viewport.width * viewport.anchorPoint.x,
            viewport.height * viewport.anchorPoint.y
            -viewport.width * viewport.anchorPoint.x,
            -viewport.height * viewport.anchorPoint.y





Share this post

Link to post
Share on other sites

oops, looks like you found an issue with the 4.1.0. We did refactor some code linked to pointer event management, and it seems that we kind of broke the mouse wheel event.

I just fixed it on the master branch, if you pull the latest version it should work then (i tested using your code snippet).

Sorry about that, and thank you 10000x for reporting it :)

Share this post

Link to post
Share on other sites

Thankyou so much.. Mousewheel event is working for me now :):) . but is there a way to differentiate mouse scroll up and mouse scroll down. for example i am trying to zoom in and zoom out using mouse scroll.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.