Menu size and resolution size problem

Hey all,


I previously made a little plugin that kept the menu size restricted to a certain width/height, so when another plugin increased the project's screen size (resolution) the menu would remain in a smaller box centered on the screen.


How I managed to do this might not have been the best way, but what I ended up doing was to temporarily modify the Graphics.boxWidth and Graphics.boxHeight to a smaller size in menus and return to normal when leaving the menus. I did it this way as most menu plugins use this variable to position and size their windows and I wanted this to work for all without having to change positioning and size code for any.


Plugin code used:

Spoiler
var Galv = Galv || {};
Galv.TEST = {};


Galv.TEST.menuWidth = 816;
Galv.TEST.menuHeight = 624;


// SCENE MENUBASE RESIZE BOX DIMENSIONS
//-----------------------------------------------------------------------------

Galv.TEST.SceneManager_initGraphics = SceneManager.initGraphics;
SceneManager.initGraphics = function() {
Galv.TEST.SceneManager_initGraphics.call(this);
Galv.TEST.boxWidth = this._boxWidth;
Galv.TEST.boxHeight = this._boxHeight;
};

Galv.TEST.Scene_MenuBase_createWindowLayer = Scene_MenuBase.prototype.createWindowLayer;
Scene_MenuBase.prototype.createWindowLayer = function() {
Graphics.boxWidth = Galv.TEST.menuWidth;
Graphics.boxHeight = Galv.TEST.menuHeight;
Galv.TEST.Scene_MenuBase_createWindowLayer.call(this);
};

Scene_MenuBase.prototype.terminate = function() {
Scene_Base.prototype.terminate.call(this);
Graphics.boxWidth = Galv.TEST.boxWidth;
Graphics.boxHeight = Galv.TEST.boxHeight;
};



This was working fine with no issues up until MV version 1.3.0 and later. Since that update, the windows in menu scenes seem to cut off a few pixels above and left of them when using this code. Example images:

Spoiler
Default (No plugins):


Gi0kJvJ.jpg



Window cut-off issue (1.3.0 and 1.3.1 using above plugin):


7vBYS0D.jpg



And 1.3.2 update actually looks like it fixed the gaps but for some reason removes a chunk from the top left:


KK0JSED.jpg



Download of a project with this setup (version 1.3.1) to see:


http://www.mediafire.com/download/vd3zu60zr2fdhr8/Galv_Menu_Issue.zip


This is more now for reference than actually needing to solve.
I´m not a pro in RPGMMV, but, what plugin are you using?


because, i have the same problem ...


maybe you maximize the window, i don´t know...


PD: Thanks @Galv for the great job you made, and your work, and the plugins, and everything!


sorry... i have to say it 😀  
It's Yanfly's Screen Resolution to change the screen size. Modifying the menu is my plugin - trying to work out why it has an issue in 1.3 🙂


I don't believe it's an issue with the screen size plugin but something that changed in the MV update.
Have any other coders out there tried to achieve this or have any ideas I could try to solve this issue?
Have any other coders out there tried to achieve this or have any ideas I could try to solve this issue?



Hi, @Galv. I've been doing this for my plugin 'Alpha ABS' Demo game. Works for almost all windows. My solution is not best, but it can help you.


Check my GitHub for download Demo or only plugin file 'TempScripts.js' (in Demo game folder). Code for resolution: 32 - 288 lines. It's not good code style because i write it very quickly and use only for my Demo game. 🙂


Screenshot:

Spoiler
2016-09-16_2-49-29.png
Thanks for the response, I really appreciate it! Not quite the ideal catch-all solution but some great ideas for setting up each window to change.


I would love to create a plugin that will be able to change all menus including unknowns.


My solution was working fine until 1.3.0 - It'd be cool to work out why it no longer does

Original thread: https://forums.rpgmakerweb.com/threads/menu-size-and-resolution-size-problem.68178/