window_has_focus();
返回: 布尔值
使用这个函数你能够得到窗口(或标签页)的状态,如果它失焦的时候,该函数会返回false,反之则返回true。大多数情况,简单的使用 os_is_paused 测试焦点是否存在,但是一些特殊的情况(比如Chrome Apps 游戏)那个函数不会触发,这时使用本节所说的这个函数替之。
NOTE: This function is only valid for the HTML5, Windows, and MacOS.
if !window_has_focus()
{
scr_PauseGame();
}
上述代码将会检测游戏窗口是否处于焦点,若为false则调用一个脚本。