• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Full Screen in Mobile Browsers

I would be very grateful for any help or comments. I have made a game in htm5 and wish for any players using a mobile phone browser (i.e. android and ios) to see the game in full screen. (By this I mean the whole game screen fits onto the browser without having to scroll left, right, up or down!) I have managed to do this successfully previously with android by using the below code:

if(os_type ==os_android)&&((os_type !=os_windows)&&(os_type!=os_macosx))
{
event_user(1);
}

Event User 1 consists of the action "change to full screen mode" (This is one of the standard actions available within the draw menu.)

However, this is not currently working for me!

Can anyone help please?
 
Hi - can anyone help with me this please? If not can someone please tell me the best way of contacting an employee of YoYo to get an answer.

Thank you!
 

klys

Member
You need to create a extension or use one to call a external javascript or html function which will make the html5 canvas goes to fullscreen

here is some info about how to send html5 canvas to fullscreen https://developer.mozilla.org/en/docs/Web/API/Fullscreen_API


----------------

Following the information from developer.mozilla.org
Basically:

NOTE: This little guide asume you are using JQuery library in your html code.

in html you will do something like this:

Code:
<div id = "fullscreen-game-window-divider">
<!-- HERE GOES YOUR HTML5 GAME CANVAS-->
</div>
on the end of the html page you will put this:

Code:
<script>
   $(document).ready(function(){
    
       var elem = document.getElementById("fullscreen-game-window-divider");
      if (elem.requestFullscreen) {
         elem.requestFullscreen();
     }

});
</script>
This should work, but i havent tested so i dont know.
Check it and tell me.
 
Last edited:
Thanks for taking the time to post. I have tried adding the above lines directly in the index.html page. However, the program does not appear at all now!

To check - you did mean to add the lines in the index.html page? Or did you mean to create an extension?

Thanks!
 

klys

Member
Well you can either create a extension to call it from GML or instead making it directly from html code.
 
Top