Skip to content

Commit 0c9361d

Browse files
authored
Update Functions-(Other).md
1 parent d6c7a44 commit 0c9361d

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

docs/7.0/Functions-(Other).md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,38 @@ _input_count_previous = _len;
206206
#### **Example**
207207

208208
```gml
209-
//Hide aim pointer and pause if focus is lost
210-
if (!input_window_has_focus() && !game_paused)
209+
//Pause if focus is lost
210+
if (!input_window_has_focus())
211+
{
212+
game_pause();
213+
}
214+
```
215+
216+
<!-- tabs:end -->
217+
218+
219+
&nbsp;
220+
221+
## …game_has_focus
222+
223+
`input_game_has_focus()`
224+
225+
<!-- tabs:start -->
226+
227+
#### **Description**
228+
229+
**Returns:** Boolean, whether the game is in focus
230+
231+
|Name|Datatype|Purpose|
232+
|----|--------|-------|
233+
|None| | |
234+
235+
#### **Example**
236+
237+
```gml
238+
//Hide aim pointer if game focus is lost
239+
if (!input_game_has_focus())
211240
{
212-
game_paused = true;
213241
obj_reticle.visible = false;
214242
}
215243
```

0 commit comments

Comments
 (0)