HTML5, can I change screen size?

Monkey Forums/Monkey Beginners/HTML5, can I change screen size?

Farflame(Posted 2014) [#1]
Pretty basic problem, but am I able to change the screen size for HTML5 output? I can't find the command for it, it seems to be stuck on 640 or 800?


Chugs(Posted 2014) [#2]
Read this thread it will tell you how:
http://www.monkey-x.com/Community/posts.php?topic=762


Farflame(Posted 2014) [#3]
Ah yeah, easy enough, but I can't change it at runtime, and respond to changes in browser size etc?


ImmutableOctet(SKNG)(Posted 2014) [#4]
Here's the thing, I'm no expert on this, but isn't this website and browser related? I mean, if you're making a browser game, you'd usually have it at a fixed resolution or in fullscreen. If I remember right, there were some posts a while ago talking about toggling fullscreen. But as for the resizing thing, don't most browsers already handle this? Not properly mind you, but I remember being able to just resize the console in the test HTML file, and having it stretch the canvas proportionally (It'll just resize; the resolution of the canvas won't be changed). After testing this, I can confirm this to be the case.

If you're building a web/browser game and want to do something like this, then you might want to look into the 'dom' (Document Object Model) module. As well as JavaScript at least somewhat, but that might not be needed.

I was going to post an example of this, but this thread should help you out, at least somewhat. I make no guarantees that it will work for you. Also note that the example nikoniko posted is using Diddy (At the bottom of the thread). You'll likely need to modify that example.

I'm really not an HTML5/JavaScript guy, but the above example, and the 'dom' module should put you on the right track. I don't have time at the moment to write a working example.

There's also some posts in the HTML5 section you can look through.