MV Fullscreen to windowed mode?

Hi, dear forum~
I need a script call that, once executed, changes the game mode from fullscreen (default) to windowed BUT at a fixed (and locked) size (as freely resizing the game window creates problems with some huds).
Is this thing possible?
To change to windowed mode at runtime, I think this will work in a Script command:
JavaScript:
Graphics._cancelFullScreen();

For startup options, go to your project folder (Game > Open Folder) and find package.json. You should be able to open it in any text editor. The default one looks like this:
Spoiler: package.json (default, v1.6.3)
JavaScript:
{
    "name": "",
    "main": "index.html",
    "js-flags": "--expose-gc",
    "window": {
        "title": "",
        "toolbar": false,
        "width": 816,
        "height": 624,
        "icon": "icon/icon.png"
    }
}
You can control fullscreen and resizing by adding these properties under the "window" section:
  • "resizable": false - disables resizing
  • "fullscreen": false - launches in windowed mode
Example:
Spoiler: package.json (no resize, start fullscreen)
JavaScript:
{
    "name": "",
    "main": "index.html",
    "js-flags": "--expose-gc",
    "window": {
        "title": "",
        "toolbar": false,
        "width": 816,
        "height": 624,
        "icon": "icon/icon.png",
        "resizable": false,
        "fullscreen": true
    }
}
Further details:
Note that by default the game runs in windowed mode, so you may have one or more plugins also affecting this.
To change to windowed mode at runtime, I think this will work in a Script command:
JavaScript:
Graphics._cancelFullScreen();

For startup options, go to your project folder (Game > Open Folder) and find package.json. You should be able to open it in any text editor. The default one looks like this:
Spoiler: package.json (default, v1.6.3)
JavaScript:
{[/INDENT]
[INDENT]    "name": "",[/INDENT]
[INDENT]    "main": "index.html",[/INDENT]
[INDENT]    "js-flags": "--expose-gc",[/INDENT]
[INDENT]    "window": {[/INDENT]
[INDENT]        "title": "",[/INDENT]
[INDENT]        "toolbar": false,[/INDENT]
[INDENT]        "width": 816,[/INDENT]
[INDENT]        "height": 624,[/INDENT]
[INDENT]        "icon": "icon/icon.png"[/INDENT]
[INDENT]    }[/INDENT]
[INDENT]}
You can control fullscreen and resizing by adding these properties under the "window" section:
  • "resizable": false - disables resizing
  • "fullscreen": false - launches in windowed mode
Example:
Spoiler: package.json (no resize, start fullscreen)
JavaScript:
{[/INDENT]
[INDENT]    "name": "",[/INDENT]
[INDENT]    "main": "index.html",[/INDENT]
[INDENT]    "js-flags": "--expose-gc",[/INDENT]
[INDENT]    "window": {[/INDENT]
[INDENT]        "title": "",[/INDENT]
[INDENT]        "toolbar": false,[/INDENT]
[INDENT]        "width": 816,[/INDENT]
[INDENT]        "height": 624,[/INDENT]
[INDENT]        "icon": "icon/icon.png",[/INDENT]
[INDENT]        "resizable": false,[/INDENT]
[INDENT]        "fullscreen": true[/INDENT]
[INDENT]    }[/INDENT]
[INDENT]}
Further details:
Note that by default the game runs in windowed mode, so you may have one or more plugins also affecting this.
Thank you!
All works perfectly, and yeah, I used a plugin to start in fullscreen!
One last thing; is there a way to set a different resolution during the game (not on startup) using something like that "Graphics._cancelFullScreen();" script thingy?~
I know that there are plugins that implement this possibility, but I was wondering if there was a less invasive method than inserting an entire new plugin for this.
One last thing; is there a way to set a different resolution during the game (not on startup) using something like that "Graphics._cancelFullScreen();" script thingy?~
You could try something like this in a Script command:
JavaScript:
window.resizeTo(816, 624);
I.e. "resize the window to 816 x 624 px". Reference:
You could try something like this in a Script command:
JavaScript:
window.resizeTo(816, 624);
I.e. "resize the window to 816 x 624 px". Reference:
Awesome! Thank you a lot!^^

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/fullscreen-to-windowed-mode.134655/