disable free window scaling

I'm just wondering how I'd disable the option of resizing the playing window freely during play. I would like to add options in the settings for set resolutions, but i dont want the player to stretch out the window manually. How would you add these resolution options? And how would you disable free window scaling? Also, is there a way to rebind the fullscreen key perhaps? F4 isnt that common these days.
Probably the easiest way to make the window non-resizable would be to use this plugin:
JavaScript:
/*:
 * @target MZ
 * @plugindesc Make window non-resizable
 * @author Arthran
 * @help Free to use and/or modify for any project, no credit required.
 */
(() => {
    const _Scene_Boot_resizeScreen = Scene_Boot.prototype.resizeScreen;
    Scene_Boot.prototype.resizeScreen = function() {
        _Scene_Boot_resizeScreen.call(this);
        if (Utils.isNwjs()) {
            nw.Window.get().setResizable(false);
        }
    };
})();
Probably the easiest way to make the window non-resizable would be to use this plugin:
JavaScript:
/*:
 * @target MZ
 * @plugindesc Make window non-resizable
 * @author Arthran
 * @help Free to use and/or modify for any project, no credit required.
 */
(() => {
    const _Scene_Boot_resizeScreen = Scene_Boot.prototype.resizeScreen;
    Scene_Boot.prototype.resizeScreen = function() {
        _Scene_Boot_resizeScreen.call(this);
        if (Utils.isNwjs()) {
            nw.Window.get().setResizable(false);
        }
    };
})();
send the .js ? EDIT: figured out how to save it haha my bad. But yeah sorry the plugin doesn't work. All you did was remove the ability for the screen to be resized, not the ability for the player to resize the screen (if that makes sense). The big screen window resize button, and the mouse prompt to resize, both still appear as if it's completely possible to do so. And not only does that look weird, but fullscreen straight up doesn't exist anymore? Pressing f4 now just repositions the window, as expected from looking at the code. That is definitely not what i asked for, but thank you for trying to help I guess.
I think if that can be done, it would be with an edit to the game's index.html, not inside the engine with a plugin.

You can do whatever you like with your game, but is there a reason why it matters? If the player wants to stretch the screen and make it pixelated, isn't that kind of up to them?

Or if they have poor eyesight and need things to be physically larger on the screen, not just take up more space which is all changing the resolution in-game accomplishes.

I'm just not sure why it's worth effort on your part to stop the user from manipulating the window. I mean, I can do that with most professional studio games if I like. 😉

Edit: I Googled "RPG Maker disable maximize" and found this post.
I think if that can be done, it would be with an edit to the game's index.html, not inside the engine with a plugin.

You can do whatever you like with your game, but is there a reason why it matters? If the player wants to stretch the screen and make it pixelated, isn't that kind of up to them?

Or if they have poor eyesight and need things to be physically larger on the screen, not just take up more space which is all changing the resolution in-game accomplishes.

I'm just not sure why it's worth effort on your part to stop the user from manipulating the window. I mean, I can do that with most professional studio games if I like. 😉

Edit: I Googled "RPG Maker disable maximize" and found this post.
I have never heard of anyone stretching out the window of a game vertically/horizontally because of eyesight problems... I completely fail to see how that would fix their problem since the game is confined to a box either way, and resizing doesn't actually stretch out anything other than the window itself which leaves ugly black boxes.

About the post you linked, I don't really know how to edit .json files. When i tried doing it via notepad the changes don't seem to save.
But yeah sorry the plugin doesn't work.
Just because it doesn't fulfill various unstated expectations that you may have had for it doesn't mean that it "doesn't work". I very clearly said that it was a way to make the window non-resizable, which is exactly what it does--nothing more, nothing less.

If by "big screen window resize button" you're talking about the maximize button, then unfortunately there is probably not a good solution for that. It's an issue with NW.js (the software that runs your game). It will look properly disabled on some people's systems (depending on their OS versions and whatnot), and it won't on some other people's systems. But either way, it still won't actually be clickable, so the player will still be unable to resize the window. The same applies for the window resizing cursor.

It's possible that the issue is fixed in newer versions of NW.js, so you can try updating it and see if that helps, but I haven't tried the newer versions, so I couldn't say for sure. Otherwise, there is a way to make the window completely frameless, which would address both concerns... but I personally don't recommend that, because then the player won't be able to manually reposition the window at all, nor will there be a button to minimize or close the window.

If updating NW.js doesn't help, then you could edit and compile your own version of NW.js, or maybe try switching to Electron. Or you could probably do something hacky like creating an executable that uses the Windows API to tinker with the NW.js window's style, bundle said executable with your game, and create a plugin that executes it when the game starts up. But all of those solutions seem like quite a bit of work for a such a negligible issue.

but fullscreen straight up doesn't exist anymore?
Well yeah, if you make the window non-resizable, then it can no longer be resized. Since fullscreen is a form of resizing the window, it won't work while the window is non-resizable. To make fullscreen work, you would need to make the window resizable again before entering fullscreen, and then you will need to make it non-resizable again after exiting fullscreen. You will also need to do something similar when you implement the resolution option system thingy you were talking about.

While my other post did clearly state that my plugin was *only* for making the window non-resizable, I guess I probably should have made the implications of taht more clear. As an apology, here is an edited version of the plugin that allows you to use fullscreen:

Spoiler: Plugin Code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Make window non-resizable
 * @author Arthran
 * @help Free to use and/or modify for any project, no credit required.
 */
(() => {
    const _Scene_Boot_resizeScreen = Scene_Boot.prototype.resizeScreen;
    Scene_Boot.prototype.resizeScreen = function() {
        _Scene_Boot_resizeScreen.call(this);
        if (Utils.isNwjs()) {
            nw.Window.get().setResizable(false);
        }
    };

    Graphics._switchFullScreen = function() {
        const win = nw.Window.get();
        if (this._isFullScreen()) {
            this._cancelFullScreen();
            win.setResizable(false);
        } else {
            win.setResizable(true);
            this._requestFullScreen();
        }
    };
})();

That is definitely not what i asked for, but thank you for trying to help I guess.
I mean, you asked for like three completely different things all in the same post. I was simply giving you one piece of the puzzle to get you pointed in the correct direction. If you're hoping that one person is going to hand you the entire system that you're asking for all in one go, then it's probably best not to hold your breath while waiting for that to happen. It's possible that such a charitable soul exists out there, but I suspect that your best bet is to be receptive towards whatever bits of help you *are* given and try to piece things together one step at a time.

I would imagine that you were bundling your questions into one post out of good intentions, but it's actually better (for you and everyone else) if you make a separate thread for each question. When you ask multiple questions in the same post, it can create a situation where multiple different conversations are going on at the same time in the same thread, which isn't very conducive to a productive discussion.

It also reduces your chances of getting help, because if someone doesn't have the time/knowledge/desire to answer all 3 of your questions, they might feel discouraged from saying anything at all (even if they could answer 1 or 2 of your questions). Saying snarky things to the few people who are willing to do so anyway doesn't really help the situation either.

I think if that can be done, it would be with an edit to the game's index.html, not inside the engine with a plugin.
...
Edit: I Googled "RPG Maker disable maximize" and found this post.
You can set the window's resizable property to false in package.json. The reason I didn't recommend that is because every time you save your project in RPG Maker, it re-writes the package.json file. So you'd have to edit it again every time right before you playtest, and you'd also have to remember to edit it after deploying the game.

The exact same property can be changed via JavaScript at run-time, triggering the exact same effect, so I recommended the plugin route instead--since you can just set it once and then forget about it.

I completely fail to see how that would fix their problem since the game is confined to a box either way, and resizing doesn't actually stretch out anything other than the window itself which leaves ugly black boxes.
AFAIK, resizing the window also resizes the game screen (while maintaining the aspect ratio) for most people. If it doesn't work that way for you, then it's possible that you've got a setting on your computer that is suppressing this behavior, or you've got a plugin that is messing with things.

About the post you linked, I don't really know how to edit .json files. When i tried doing it via notepad the changes don't seem to save.
See my above reply to ATT_Turan.
I have never heard of anyone stretching out the window of a game vertically/horizontally because of eyesight problems... I completely fail to see how that would fix their problem since the game is confined to a box either way, and resizing doesn't actually stretch out anything other than the window itself which leaves ugly black boxes.
...did you try? Because resizing the RPG Maker game window absolutely resizes the content inside. The black borders appear when the window is the wrong aspect ratio compared to the game's resolution. This has been pretty common knowledge since the '90s.

If your defined resolution is a significant portion of the display area to begin with then you might not see much difference because it isn't expanding much. But when I start a new project at the default resolution on a 1080p display and maximize it, I can very clearly see a difference in the size of the sprites and their pixel quality.

The exact same property can be changed via JavaScript at run-time, triggering the exact same effect
Good to know
Just because it doesn't fulfill various unstated expectations that you may have had for it doesn't mean that it "doesn't work". I very clearly said that it was a way to make the window non-resizable, which is exactly what it does--nothing more, nothing less.
Poor choice of words by me, I meant that it doesn't work for what I'm trying to do.
If by "big screen window resize button" you're talking about the maximize button, then unfortunately there is probably not a good solution for that. It's an issue with NW.js (the software that runs your game). It will look properly disabled on some people's systems (depending on their OS versions and whatnot), and it won't on some other people's systems. But either way, it still won't actually be clickable, so the player will still be unable to resize the window. The same applies for the window resizing cursor.
That's unfortunate, but nothing to do about that I suppose.
If updating NW.js doesn't help, then you could edit and compile your own version or NW.js, or maybe try switching to Electron. Or you could probably do something hacky like creating an executable that uses the Windows API to tinker with the NW.js window's style, bundle said executable with your game, and create a plugin that executes it when the game starts up. But all of those solutions seem like quite a bit of work for a such a negligible issue.
Sounds complicated. I would have to spend a long time learning how that works. Maybe I'll look into it later down the line.
While my other post did clearly state that my plugin was *only* for making the window non-resizable, I guess I probably should have made the implications of taht more clear. As an apology, here is an edited version of the plugin that allows you to use fullscreen:
Thanks, works great.

AFAIK, resizing the window also resizes the game screen (while maintaining the aspect ratio) for most people. If it doesn't work that way for you, then it's possible that you've got a setting on your computer that is suppressing this behavior, or you've got a plugin that is messing with things.
Yeah, it doesn't work for me. Well, that's trivial anyway. By the way, sorry if I sounded rude in my replies, didn't mean to come across that way.
...did you try? Because resizing the RPG Maker game window absolutely resizes the content inside. The black borders appear when the window is the wrong aspect ratio compared to the game's resolution. This has been pretty common knowledge since the '90s.

If your defined resolution is a significant portion of the display area to begin with then you might not see much difference because it isn't expanding much. But when I start a new project at the default resolution on a 1080p display and maximize it, I can very clearly see a difference in the size of the sprites and their pixel quality.
I don't know man. I just get black boxes and nothing stretches out.
Yes, I have tried resizing the RPG Maker game window and can confirm that it does resize the content inside. The black borders appear when the window is the wrong aspect ratio compared to the game's resolution, which is common knowledge since the '90s. If the defined resolution is a significant portion of the display area, then there might not be much difference in the size of the sprites and their pixel quality. However, if starting a new project at the default resolution on a 1080p display and maximizing it, a noticeable difference in the size of the sprites and their pixel quality can be seen.

Original thread: https://forums.rpgmakerweb.com/threads/disable-free-window-scaling.154948/