I’ve run up against a rather bad behavior by iOS (iPad) in fullscreen mode, the Defold app doesn’t properly go fullscreen AND iOS puts up a warning dialog when it detects the user tapping on the screen. As far as I can tell, you cannot turn off this warning dialog, and each time it shows, it stops your game.
So my solution is to hide fullscreen button on iOS HTML5. I’ve written some Javascript code to hide the button bar, but the space allocated for the bar is still there and now empty. I’d like to see that space available for my game, not just an empty block below the game.
Any idea how to accomplish this?
<div id="buttons" class="buttons-background">
{{#html5.show_fullscreen_button}}
Fullscreen
{{/html5.show_fullscreen_button}}
<script id='engine-start' type='text/javascript'>
var isMobile = {
Android: function() {return navigator.userAgent.match(/Android/i);},
iOS: function() {return navigator.userAgent.match(/iPhone|iPad|iPod/i);},
any: function() {return (isMobile.Android() || isMobile.iOS())}
}
var buttons = document.getElementById("buttons");
if (isMobile.iOS()) {
buttons.style.display = "none"
}
var runningFromFileWarning = document.getElementById("running-from-file-warning");
if (window.location.href.startsWith("file://")) {
runningFromFileWarning.style.display = "block";
}
else {
EngineLoader.load("canvas", "{{exe-name}}");
runningFromFileWarning.parentNode.removeChild(runningFromFileWarning);
}
</script>