Search code examples
htmlcanvashtml5-canvasconstruct-2

Mouse stop clicking when fully loaded


I made a game and I used construct 2 to build it, I have a problem regarding the mouse clicking (outside the game) for example the user cant scroll down using the mouse (left click) only keyboard or scroll button on the mouse.

What could be the problem ? Thanks


Solution

  • Search for this code in the file c2runtime.js, you should also uncheck the minify option when you export the project.

    if (this.useMouseInput && !this.runtime.isDomFree)
        {
            jQuery(document).mousemove(
                function(info) {
                    self.onMouseMove(info);
                }
            );
            jQuery(document).mousedown(
                function(info) {
                    self.onMouseDown(info);
                }
            );
            jQuery(document).mouseup(
                function(info) {
                    self.onMouseUp(info);
                }
            );
        }
    

    And remove it