• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 Bug with device_mouse_x_to_gui(0)

M

Mylon

Guest
So I'm at the GUI step of my game and I was hoping there was a quick and easy method to account for panning/zoom so I can click my GUI buttons properly. I thought I could use device_mouse_x_to_gui but this is returning the room_x, making it not what I expected.

In this screenshot, I set the top left number to device_mouse_x_to_gui(0). At the start, the left side of the screen says -1 (which is odd but whatever), but if I pan the camera without moving the mouse it changes. In this screenshot I panned to the left, giving me a negative number. This shouldn't ever return a negative number! At least not without touching the gui scaling.

http://imgur.com/2KMIS4B
 
M

Mylon

Guest
I changed the build target to windows and retested it and device_mouse_x_to_gui(0) works as expected. Definitely a problem with the HTML5 target.
 
Top