Fullscreen on iOS9

0 favourites
  • 4 posts
  • 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.

    <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>
    [/code:3i1p52gv]
    
    Now with construct2 I can't seem to get the equivalent to work. Did anybody ever find a solution for this?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)