htmL 5 full screen on browsers and mobile browsers

Discussion in 'Legacy GameMaker Community Tech Support' started by Woopsicles, Dec 24, 2016.

  1. Woopsicles

    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?
  2. Gamely

    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).
  3. Woopsicles

    Woopsicles Guest

    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?
  4. chmod777

    chmod777 Member

    Aug 26, 2016
    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).
  5. qst0

    qst0 Member

    Jan 31, 2019
    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!

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice