• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Mouse is offset whenever the screen is scrolled.

Kaliam

Member
Hello, I'm working on a HTML5 game which is contained in a webpage but lower down on the page, when you scroll down to the game, the mouse gets offset by the scrolling which is very annoying. Is there a way to fix this or is it a bug? The scrolling isn't 1:1 so it's doesn't seem possible to offset the coordinates by the scroll amount . This basically breaks my whole website and it happens on any HTML5 game. You can reproduce this by just making a new game, setting an object xy to mouse_x, mouse_y, and then making the screen small enough to cause the screen to scroll.

Any help would be amazing!
 

gorla0x

Member
I'm having the same problem. If you find a solution please post in the thread. I noticed that the way itch. io handles HTML exports seems to avoid the problem. I'm wondering whether it is more an HTML scripting code problem than a GameMaker code problem.
 

Kaliam

Member
It seems to happen on even the auto generated index.html page created by YoYo, if you size the screen small enough to cause scrolling, this error still occurs.
 
Top