Skip to main content

The "window_set_cursor_sprite" Function

Syntax#

window_set_cursor_sprite(sprite);
ArgumentTypeDescription
spritespriteThe sprite to assign as a mouse cursor

Description#

Assigns a sprite to the cursor using consistent syntax with the primary window_set_cursor function. Note that the sprite origin point will be used as the cursor hotspot.

While it is not required, it is highly recommended to include obj_server_gmlp in the project when using this script. The obj_server_gmlp object will handle automatically switching between system and sprite cursor types, as well as provide additional mouse coordinate and visibility variables. (See Built-in Variables for a complete list.)

To disable the cursor sprite, use cr_none. However, if obj_server_gmlp is present, cr_none will be ignored, and you should use mouse_visible = false to hide the cursor, or window_set_cursor(cr_default) to restore the system cursor instead.

Example#

window_set_cursor_sprite(spr_cursor);