You are not logged in.
Pages: 1
I always hated built in GM variables and here's an example why. I am drawing a custom sprite as a sprite in my game where I am often zooming in and out which means I have to adjust the cursor's size depending on the view's scale.
Whenever I drew the adjusted cursor sprite, it was ticking on the screen such as if the cursor was buggy. Then I found a little awesome new tricks. Instead of using "mouse_x", I now always use window_mouse_get_x() which does not round the cursor's position to the nearest integer.
Instead, I use this :
mouseX = view_xview+window_mouse_get_x()/window_get_width()*view_wview;
the difference between this and mouse_x is pretty huge since playing a game that is 4x zoomed out on a fullscreen and pretty big monitor, it doesn't tick anymore. When I compared both values, there was decimal differences which was enough to make it very uncomfortable.
I am not sure if I have been clear there thought .
Offline
Great tip! It would not have occurred to me that there would ever be a practical difference in the two ways to read the mouse.
Abusing forum power since 1986.
Offline
Pages: 1