Pixel-Composer/scripts/mouse_input/mouse_input.gml

30 lines
664 B
Text
Raw Normal View History

2022-12-23 10:45:52 +07:00
#region mouse global
2024-01-16 17:00:39 +07:00
globalvar MOUSE_WRAP, MOUSE_WRAPPING, MOUSE_BLOCK, _MOUSE_BLOCK;
2023-04-07 21:25:27 +02:00
2023-12-05 15:51:24 +07:00
MOUSE_WRAP = false;
2022-12-23 10:45:52 +07:00
MOUSE_WRAPPING = false;
2024-01-16 17:00:39 +07:00
MOUSE_BLOCK = false;
_MOUSE_BLOCK = false;
2022-12-23 10:45:52 +07:00
2023-10-31 11:30:42 +07:00
#macro SCROLL_SPEED PREFERENCES.mouse_wheel_speed
2023-04-07 21:25:27 +02:00
2022-12-23 10:45:52 +07:00
function setMouseWrap() {
2023-12-05 15:51:24 +07:00
INLINE
2022-12-23 10:45:52 +07:00
MOUSE_WRAP = true;
}
2024-01-16 17:00:39 +07:00
#endregion
function mouse_click(mouse, focus = true) {
INLINE
return !_MOUSE_BLOCK && focus && mouse_check_button(mouse);
}
function mouse_press(mouse, focus = true) {
INLINE
return !_MOUSE_BLOCK && focus && mouse_check_button_pressed(mouse);
}
function mouse_release(mouse, focus = true) {
INLINE
return focus && mouse_check_button_released(mouse);
}