sutee's Forum Posts

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

  • I am embedding an HTML5 game that runs in landscape mode into an iFrame. The game has a layer which asks the user to rotate the phone if he/she holds it in portrait mode.

    The activitiy "Browser.isPortrait" does not fire, however. I checked in the c2runtime, and it looks like the code is very basic:

    Cnds.prototype.IsPortraitLandscape = function (p)
    {
    	var current = (window.innerWidth <= window.innerHeight ? 0 : 1);
    	return current === p;
    };
    [/code:3ggzgtpe]
    
    Now, this always returns landscape of course, because the iframe's width is larger than it's height, no matter what the device orientation is. How can I display a message asking the user to turn the device inside an iFrame?
  • 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.

  • 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?
  • 4 posts