display_mouse_set

With this function you can change or set the position of the mouse within the game display which can be useful for FPS games, for example. The function will only work while the game is in focus and using ALT + Tab will unlock the mouse.

NOTE This function is only usable on Desktop platforms (i.e. Windows, Mac and Ubuntu).

 

Syntax:

display_mouse_set(x, y);

ArgumentTypeDescription
xRealThe x coordinate in the display.
yRealThe y coordinate in the display.

 

Returns:

N/A

 

Example:

display_mouse_set(display_get_width() / 2, display_get_height() / 2);

The above code would center the mouse in the game display.