NoobsWeStand
Member
I have it so in my game you can right click and move your mouse to rotate your character
Sometimes, when you click outside the window, and the refocus it, window_mouse_set no longer works until you unfocus and refocus the window.
This is really annoying as sometimes when trying to rotate my character, it will spin out of control because the mouse is not locked in place
I also tried display_mouse_set, but the same thing happens.
Here is my code:
Is this a bug, or am I doing something wrong?
Sometimes, when you click outside the window, and the refocus it, window_mouse_set no longer works until you unfocus and refocus the window.
This is really annoying as sometimes when trying to rotate my character, it will spin out of control because the mouse is not locked in place
I also tried display_mouse_set, but the same thing happens.
Here is my code:
Code:
if mouse_check_button_pressed(mb_right){
mousex=window_mouse_get_x();
mousey=window_mouse_get_y();
window_mouse_set(mousex,mousey);
window_set_cursor(cr_none)
chang_x=obj_player_self.direction
}
if mouse_check_button_released(mb_right){window_set_cursor(cr_default)}
if mouse_check_button(mb_right){
obj_player_self._rightClick=1
var px=chang_x;
chang_x+=(mousex-window_mouse_get_x())/8*-1;
change_y+=(mousey-window_mouse_get_y())/8;
change_y=median(-190,change_y,190);
obj_player_self.direction=floor(chang_x)
window_mouse_set(mousex,mousey);
}
Is this a bug, or am I doing something wrong?