Last active
September 16, 2019 18:37
-
-
Save katsaii/b6bdf4a3ef5d7b4d930bbc7ef2a11c02 to your computer and use it in GitHub Desktop.
A script for enabling/disabling mouse input in GameMaker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gml_pragma("global", @' | |
global.mouse_clicks = true;'); | |
/// @desc Disables/enables mouse clicks. | |
/// @param enable {Bool} Whether to enable mouse clicks. | |
/// @author Kat @katsaii | |
var enable = bool(argument0); | |
if (enable ^^ global.mouse_clicks) then global.mouse_clicks = enable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @desc Returns whether mouse clicks are enabled. | |
/// @author Kat @katsaii | |
return global.mouse_clicks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#macro mouse_check_button scr_mouse_click | |
/// @desc Checks for a mouse click. | |
/// @param button {Integer} The id of the mouse button to check. | |
/// @author Kat @katsaii | |
return global.mouse_clicks && device_mouse_check_button(0, argument0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#macro mouse_check_button_pressed scr_mouse_click_pressed | |
/// @desc Checks for a mouse click. | |
/// @param button {Integer} The id of the mouse button to check. | |
/// @author Kat @katsaii | |
return global.mouse_clicks && device_mouse_check_button_pressed(0, argument0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#macro mouse_check_button_released scr_mouse_click_released | |
/// @desc Checks for a mouse click. | |
/// @param button {Integer} The id of the mouse button to check. | |
/// @author Kat @katsaii | |
return global.mouse_clicks && device_mouse_check_button_released(0, argument0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment