is_mouse_over_debug_overlay

如果鼠标位于调试叠加层窗口或小工具上方,或者调试叠加层以任何其他方式使用 (即拖动窗口时),则此函数会返回 true

只要鼠标位于菜单或窗口上,鼠标就会位于 调试叠加层 上。

 

语法:

is_mouse_over_debug_overlay();

 

返回:

Boolean

 

例子:

Step Event

if (!is_mouse_over_debug_overlay())
{
    if (keyboard_check_pressed(vk_control))
    {
        instance_create_layer(mouse_x, mouse_y, layer, obj_enemy);
    }
}

上面的代码示例首先使用 is_mouse_over_debug_overlay 检查鼠标是否位于 调试叠加层 的任何菜单或窗口上。如果没有,则使用 keyboard_check_pressed 检查是否按下了 Ctrl 键。如果是这种情况,则会在鼠标位置创建对象 obj_enemy 的实例。