Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Keep game running out of focus
Started by usacb Jan 23 2019 02:03 PM

- - - - -
4 replies to this topic
html5 focus backgroud
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

usacb

[GLOBAL: userInfoPane.html]
usacb
  • Observer

  • 7 posts
  • Corona SDK

Hello, I just noticed that if the browser window is not on focus the game stops or pauses, then when on focus again the game resumes.

 

How to enable the game to be continuously running even if the browser window is out of focus or minimized?

 

Thanks in advance. 



[TOPIC: post.html]
#2

lg5200

[GLOBAL: userInfoPane.html]
lg5200
  • Observer

  • 13 posts
  • Corona SDK

++++



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,788 posts
  • Enterprise

As a rule, Corona apps are not designed to be run in the background. I would assume this applies to HTML5 builds as well, but I'm verifying with Engineering.

 

Rob


  • hiramatsu likes this

[TOPIC: post.html]
#4

lg5200

[GLOBAL: userInfoPane.html]
lg5200
  • Observer

  • 13 posts
  • Corona SDK

When an application is embedded in social networks, then there the payment and invitation windows stop the application - this is bad!

  • hiramatsu likes this

[TOPIC: post.html]
#5

hiramatsu

[GLOBAL: userInfoPane.html]
hiramatsu
  • Observer

  • 1 posts
  • Corona SDK

To avoid pauses, I edited coronaHtml5App.js in fbinstant_app.zip.
I removed "blur" callback like this. 
 
 
In the function "_emscripten_set_blur_callback", 
function _emscripten_set_blur_callback(target,userData,useCapture,callbackfunc){JSEvents.registerFocusEventCallback(target,userData,useCapture,callbackfunc,12,"blur");return 0}

remove registerFocusEventCallback

function _emscripten_set_blur_callback(target,userData,useCapture,callbackfunc){return 0}

 

 

It works fine on Facebook instant games.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: html5, focus, backgroud