Lollipoppingu

Warper
Member
Joined
Sep 7, 2021
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMMZ
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
 

Attachments

  • Immagine 2021-09-19 011910.png
    Immagine 2021-09-19 011910.png
    501.3 KB · Views: 47

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,006
Reaction score
16,821
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Javascript. Thank you.

 

casper667

Casper Gaming
Veteran
Joined
Mar 15, 2012
Messages
460
Reaction score
578
First Language
English
Primarily Uses
RMMZ
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.
 

Lollipoppingu

Warper
Member
Joined
Sep 7, 2021
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMMZ
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 :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Just got done hand feeding some baby raccoons who were orphaned when the mother was killed by a car.

First time in my life I've done it and they are adorable.

Taking them in the morning to a Rescue that specializes in wild animals so they will survive. :D
Went a little overboard with the last side quest. Added in another decent-sized puzzle.
Okay... OneDrive just creeped me out... Even though I don't even have it installed or running on this machine, I just got an email from it wanting to remind me of my memories of this day of June from several years ago, and it was some of my drawings that I can't share here... quite creepy...
I-I'm also a developer!
x5uDBb.png


Big update incoming tomorrow! After some streamer feedback I am adding and recreating multiple facets of the game! Expect:

  • New Challenge Modes!
  • Completely revamped stats and attack types!
  • Additional positioning options!
  • More hidden easter eggs, will you find them??
  • Additional balancing!

Forum statistics

Threads
131,620
Messages
1,221,649
Members
173,352
Latest member
MayVieSan29
Top