(SOLVED) How do i check if the game is alt-tabbed?

wanted to pause the game when it’s not selected. How do i do that?

Unless there has been changes recently to how electron works: Game logic doesn’t progress when the game isn’t focused. The only thing that continues (as far as I know) is music.

Since you cannot process game logic when it isn’t focused, I’m not entirely sure you can pause the music side of things, although you might try with the “Window is focused” condition.

1 Like

Yes that works. And there is the “Pause when losing focus” extension, but it just sets the volume to 0, without pausing the track.

1 Like

those worked, thanks!