DylanD Posted July 16, 2018 Share Posted July 16, 2018 Good morning everyone, I noticed in my scene if someone were to switch away from the tab(in browser tab I mean) that the game would keep running but would not run properly, as in intersects mesh would recognize intersecting, and some other stuff. I was wondering if there was a way to check if the left the page or something like that so I could make it hit my pause button. Any ideas? Thanks everyone! Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Hello you can register with window events: window.addEventListener("blur", this._onBlur); window.addEventListener("focus", this._onFocus); DylanD 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 17, 2018 Author Share Posted July 17, 2018 5 minutes ago, Deltakosh said: Hello you can register with window events: window.addEventListener("blur", this._onBlur); window.addEventListener("focus", this._onFocus); Blur being leaving the screen? and focus being coming back to the screen... I assume. Thanks DeltaKosh I will try it out! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 17, 2018 Author Share Posted July 17, 2018 @Deltakosh Thanks it works great! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.