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

Fit HTML game to mobile window screen

RizbIT

Member
Mobile screens can be many different sizes.

I am creating a HTML5 game that is to be shown in a mobile browser.

Is there anyway to (during runtime) or maybe using HTML code external to GMS, scale the HTML game to fit the browser (or mobile screen) so it appears fullscreen?
 
Well, inside of GameMaker you can use window_get_width() and _height() - in HTML5 they will get the game's available space in the browser, meaning if your game is not placed among other content they will return the full browser area. If you want to go completely fullscreen I believe you can use the window_set_fullscreen() function in HTML5 as well :)

Outside of GameMaker I know very little about, other than you can probably wrap the game in a div, which I guess you can make to fill up the whole screen (or at least the browser).

I am sorry I cannot be of more help, but I only recently started doing HTML5 stuff myself ^^
 

RizbIT

Member
this worked for me, not perfect and takes a bit of playing with esp with the "min()" functions....well I just removed it
 

True Valhalla

Full-Time Developer
GMC Elder
I use a combination of internal and external functionality to get the best results. But it's too complicated to explain the external functionality in a single post, unfortunately. You can do a whole lot with the internal functionality alone though.

Check out the Mobility Engine.
 
Last edited:
Top