MZ Menu window size and position

Hi, a quick question:

Currently I have commented these lines in the rmmz_scenes.js file to remove the character and gold windows:
// this.createGoldWindow();
// this.createStatusWindow();
// this._statusWindow.refresh();

Now, is there a way to position the menu in the center and resize it?
Thank you
Moved to: Learning Javascript
Window position and size in MZ is usually defined in a rect function called when the window is created (for the menu command window, this would be Scene_Menu.prototype.commandWindowRect).

You can change this function to change the position/size of the window.

Example:

JavaScript:
Scene_Menu.prototype.commandWindowRect = function() {
    const ww = this.mainCommandWidth();
    const wh = this.calcWindowHeight(4, true); // 4 is how many lines tall the window will be
    const wx = Graphics.boxWidth/2 - ww/2;
    const wy = Graphics.boxHeight/2 - wh/2;
    return new Rectangle(wx, wy, ww, wh);
};

I would also caution against editing the rmmz_scenes.js file directly since your changes will be overwritten when updating the corescript (and it will also make debugging harder). It is better to make a separate js file with just your changes and import that into the plugin manager.
Window position and size in MZ is usually defined in a rect function called when the window is created (for the menu command window, this would be Scene_Menu.prototype.commandWindowRect).

You can change this function to change the position/size of the window.

Example:

JavaScript:
Scene_Menu.prototype.commandWindowRect = function() {
    const ww = this.mainCommandWidth();
    const wh = this.calcWindowHeight(4, true); // 4 is how many lines tall the window will be
    const wx = Graphics.boxWidth/2 - ww/2;
    const wy = Graphics.boxHeight/2 - wh/2;
    return new Rectangle(wx, wy, ww, wh);
};

I would also caution against editing the rmmz_scenes.js file directly since your changes will be overwritten when updating the corescript (and it will also make debugging harder). It is better to make a separate js file with just your changes and import that into the plugin manager.
Perfect thank you 🙂

Original thread: https://forums.rpgmakerweb.com/threads/menu-window-size-and-position.140577/