Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Your project is amazing and has helped me a lot with something I don't understand very well. However, I've run into something quite curious. If I create a button hitbox using point_in_rectangle together with device_mouse_x_to_gui(0) and device_mouse_y_to_gui(0) to detect clicks or touches, everything adjusts as expected when I open the browser's Developer Tools (F12) and switch to mobile view. The problem is that clicks/touches within that area are no longer detected by the hitbox. I've tried many different approaches but haven't been able to solve it. Could you give me a hint or point me in the right direction?

As I mention in my replies on the blog, depending on exact functions, you may have to account for your canvas scale when taking in coordinates – ideally someone should send a PR to the GM HTML5 runtime but there’s a bunch of places where something happens at canvas/page scale.