Fullscreen on iOS9

Ideas and discussion about publishing and distributing your games

Post » Thu Jan 28, 2016 2:38 pm

Hi,

I am pretty new to Construct2, and am running into a problem with the export to HTML5.

I need my game to run in Safari on iOS9 in Landscape Mode at full screen. I searched the web, and it seems that apple is doing everything to keep people from using the feature. However, I found the following code that actually works for a game I did in ImpactJS.

It relies on the fact that if the content is 100% and 1px large, the Scrollbars will disappear.

Code: Select all
<head>
...
<style type="text/css">
...
    div.content { height: 100%; }
    div.spacer { height: 1px; }
...
</style>
</head>
<body>
   <div class="spacer"></div>
   <div class="content">
      <canvas id="canvas"></canvas>
   </div>
</body>


Now with construct2 I can't seem to get the equivalent to work. Did anybody ever find a solution for this?
B
3
Posts: 4
Reputation: 183

Post » Tue Feb 02, 2016 10:27 am

I finally got this working by proceeding as follows:

1) Export the game as HTML5 to be embedded, without any modifications.
2) Create a separate page with an iFrame Element. Resize this iFrame Element (by script on rotation and resize events) to the window.innerWidth and window.innerHeight.

Now on the page with the iFrame, the game will occupy the full screen. This only works on the iPhone. It broke Fullscreen on Android, however. This is relatively easy to fix by adding the properties:
allowFullScreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true".

If anybody has a solution without the Full Screen API (which is broken on Firefox Android), let me know.
B
3
Posts: 4
Reputation: 183

Post » Tue Feb 02, 2016 12:28 pm

Apple want to prevent webpages from forcing themselves to go fullscreen. There have been various hacks to fake fullscreen in Safari over the past few years, and they usually break or get changed in the next iOS release. So anything you come up with will likely be brittle and break quickly. The best solution is to encourage use of add-to-homescreen, publish a Cordova app, or hope Apple implement the fullscreen API in the next version.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Tue Feb 02, 2016 1:54 pm

Hi Ashley, yes, I am aware of that. But is there a way to get the browser bars to disappear on Android? Because the fullscreen API there in Firefox for example is hit and miss.
B
3
Posts: 4
Reputation: 183


Return to Distribution and Publishing

Who is online

Users browsing this forum: No registered users and 0 guests