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

htmL 5 full screen on browsers and mobile browsers

W

Woopsicles

Guest
I don't fully understand the how full screen works with html 5 and have a few questions.


1) Is it possible to full screen a game with code?
I am aware you can use F11 to hide the address bar, but if there is other stuff surrounding the game window that doesn't get removed with F11
2) If it is possible, would it work on a mobile browser eg safari/chrome on an iphone?
If its not possible that's fine it just means ill just put it as the only thing on its link so the F11 will full screen it on a PC.

3) Can I do the F11 thing to hide the address bar on a mobile browser?
Because there is no F11 key on a phone, can I use code in game to duplicate its function?

Basically I want my game to be able be full screen on mobiles, PC, tablets etc with no address bars or adds covering the screen. Can I do this or would I have to make a html export for PC and a mobile export for phones?
 
G

Gamely

Guest
It's not related to game maker per se ,but it is a browser feature you can use Fullscreen Api from javascript (you can put a script tag in your html file).
 
W

Woopsicles

Guest
It's not related to game maker per se ,but it is a browser feature you can use Fullscreen Api from javascript (you can put a script tag in your html file).
Thanks for the reply. After reading most of the link you've posted I think it's answered my questions. But how do you use the Fullscreen Api? Is there a command in game maker or would it be done in the website code?
 

chmod777

Member
The only built-in solution to set fullscreen in HTML5 (because the built-in function window_set_fullscreen has no effect) is:
Global game settings => HTML5 => Graphics => Allow switching to fullscreen

BUT :
- this only works by pressing the F10 key.
- it's broken in Firefox.
- there is no forward compatibility with unprefixed fullscreen functions.
- a good point though: if the browser doesn't support the fullscreen api, the width and height of the game will be maximized to the window size.

Otherwise, you'll have to code your own fullscreen system (by using an extension in Game Maker or in your html file, I think you can do that at your convenience).
 
Q

qst0

Guest
Just an update for anyone finding this in 2019, firefox is working well with F10 key.
Otherwise a js / css solution that works with your gms2 setup (depending on cameras and room size I'm sure) might be another way.
Good luck!
 
Top