display_mouse_get_x

Returns the x coordinate of the mouse relative to the display.

Syntax:

display_mouse_get_x();


Returns: Real


Description

This function will return the mouse x position within the screen. It should be noted that this function only works properly when used on the Windows target. It can be used for HTML5 too, but will only return a value relative to the 0,0 of the canvas itself, and will not return any value while the mouse is outside of the canvas. For other devices it will return 0, and you should use the device_mouse_raw_x and device_mouse_raw_y functions instead.


Example:

my_x = display_mouse_get_x();

This would set my_x to the x coordinate of the mouse relative to the display.


Back: Windows And Views
Next: display_mouse_get_y
© Copyright YoYo Games Ltd. 2017 All Rights Reserved