🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Automatically scaling window for html5 games

A topic by Tsun created 76 days ago Views: 69 Replies: 2
Viewing posts 1 to 2

I just tried out uploading some of my projects, and I noticed there's no way to make the window scale automatically to fit the browser window. The best option is the full-screen button, but that's not very ideal IMO.

It would be cool if it was possible to either select an option where the game iframe scales with the browser window size, or add some kind of an "enlarge" button that does it instead of the "full-screen" button.

Add this style in your browser dev tools to see what I mean:

#inner_column{
    width:100%!important;
    }
.view_game_page.view_html_game_page.ready .game_frame{
    height: calc(100vh - 150px)!important;
    width: calc(100vw - 100px)!important;
    }
Moderator

There's a problem with that: if the game opens in full screen, where do you put a description, downloads, comments, buttons to link and rate the game...?

It's not full screen, it's the same as if the game size matched your browser window by accident. If you leave a little bit of padding as in my example CSS, the top menu bar and a part of the description are still visible so the visitor can realize that they can scroll down.

Here's a video of it in action (flashing epilepsy warning):

https://a.cocaine.ninja/gpwttb.webm