Game doesn't recover from orientation change

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Has anyone bumped into this issue? I'm wondering if there is some workaround to it..

    "If you rotate the game from portrait to landscape then back to portrait, or click outside the framework, the game becomes unresponsive."

    This is being reported by FGL QA on some of my games.

  • This unresponsiveness is shown on this video (sorry for poor quality):

    Please login to see this link.

    As you can see, once I have changed the orientation from landscape to portrait, the game doesn't anymore react to touch as it should - instead it starts to scroll the page. This problem is currently keeping two of my games from passing the FGL QA.

    This seems to happen only when the FGL object is added to the frame or somewhere in the project.

  • Now this was spotted in my other games, too, so they are now all failing the QA..

    Apparently the issue happens with every Fusion generated HTML5 app with the FGL object in the frame. Could we have this fixed, please?

  • Thanks for the tip Olivier, but when I used that workaround the next problem I ran into was that the music and timers don't stop running when switching browser tabs (naturally, as "run even if not focus" is enabled), and this was also raised by FGL QA.
    Do you know if there is some way to pause the music and selected events when the application is not in focus?

  • I tried to compare mouse coordinates to check if the cursor is not on the game screen and then stop the music etc, but unfortunately that didn't work either.

    So I'm stuck. Both the orientation issue and the workaround to 'solve' it prevent the games from passing the QA..

    Quote from FGL QA


    We can't let the game pass QA until the reported issue is fixed. It is a crucial issue that might get your game rejected on the app stores if we ingnore it.

    Could Clickteam please take a look at this?

  • Should be easy to implement, DOM api gives off 'focus' event when page has focus and 'blur' event when page/tab loses focus, aka clicked out of window or change to a different tab.

    Adding in a Fusion event shouldn't be too difficult,

    Really named Ben Otter, but oh well, eh?

  • Thanks for the idea, but unfortunately none of the Window Control object's conditions work properly in HTML5: Window has NOT focus is triggered always, Window is NOT visible does nothing, Application is NOT active does nothing, Window is minimized does nothing. :(

    So it seems to me that there is a need for a new condition to Fusion that could tackle this issue.

  • Alright, decided to take an official crack at this bug.

    Just a bit of info that would be helpful, on what browsers and/or devices are you guys using to test your apps on?

    I'll also update this thread with my progress on the issue.

    Really named Ben Otter, but oh well, eh?

  • The orientation problem happens for example: Kindle Fire HD, Android Chrome (or iPhone Safari, can't remember which one) and FGL's web browser tool, which they use for QA for HTML5 games (Please login to see this link.).

  • Huh, cannot seem to reproduce bug, tested it with FGL QA Tool on iOS Safari (iPhone/iPad) and Android Chrome,

    I tried reorienting the devices, and touching outside the games display area, all with "Run Even If Not In Focus" disabled.

    Going to test a few more scenarios, and report back.

    Really named Ben Otter, but oh well, eh?

    Edited 2 times, last by DracisLooby: Moved to new post for bump (November 28, 2014 at 10:48 PM).

  • Found it, I'm pretty sure I've found the source of the bug, and got a fix working.

    The Issue seems to stem from FGL using HTML IFrames to isolate games. Clicking outside the IFrames would make the game loose focus, and never regain it, even when clicked.

    My fix for this is to have the HTML5 Runtime detect if its in an IFrame, and if it is, listen to the parent pages events for gaining and loosing focus, instead of its own. This seems to work in my tests on Firefox, Chrome, Internet Explorer 10, iOS Safari, and Android Chrome, but It still needs more testing, and it might not work if the parent window forces the IFrame to be sand-boxed.

    Really named Ben Otter, but oh well, eh?

  • MJK the problems you are encountering with your games on FGL are stumping me really. :)

    I have tested my game again with mobile devices (iPod/Safari and Samsung/Chrome) with the URL provided to me by FGL:
    Please login to see this link.

    I can confirm that there is no problem with orientation change. And by opening another tab in the browser, the game pauses as well as the audio. When returning to the tab with the game, the game as well as the audio resume as they should.
    The game was built with the build 283.1. In the HTML5 properties of the app the option "Run even if not focus" is checked. And in the runtime properties of the app the option "Do not mute samples when app loses focus" is not checked.

  • Hi Olivier - I have the exact same settings in Fusion properties and the same build of Fusion as you, but my latest games get rejected by QA due to these reasons.

    1. "Run even if not focus" is a workaround to the orientation issue, but then the game doesn't pause when switching tabs --> this is reported on "Web Browser Tool" that FGL uses for QA.

    Quote


    Problem(s) Found:
    01. Game does not pause when switching tabs. (Web Browser Tool)


    2. If "run even if not focus" is unchecked, the orientation issue occurs on some devices/browsers.
    Video: Please login to see this link.

    Quote


    Problem(s) Found:
    01. If you rotate the game from landscape to portrait then back to landscape, or click outside the framework and tap back on the game, it becomes unresponsive. But if you click on the white bars on top of the game, it will start working again

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!