I have my battle log's window set as visible, however it is extremely large. I have tried poking around in the rmmz_windows.js file, but I can't seem to figure out how to change the size of the window itself, only the location of the text. Does anybody know how to change the window size (and maybe location)? I've spent way too long on this.
How to change the size of the battle log window?
RPG Maker MZ SupportThe scene initialises a window's size on creation. Try something like this?
If you want to change the height, be aware that the core scripts set it to be 10 lines high and never resize it (only the visual background dimmer resizes). So in that case I believe you'd also want to either override the log window's
JavaScript:
/*:
* @target MZ
* @plugindesc Change battle log window starting size/position.
* @url https://forums.rpgmakerweb.com/threads/173956/
* @help Free to use and/or modify for any project, no credit required.
*/
// Override - change battle log window width/x/y.
;void (() => {
"use strict";
const alias = Scene_Battle.prototype.logWindowRect;
Scene_Battle.prototype.logWindowRect = function() {
const r = alias.apply(this, arguments); // get original rect
r.width >>= 1; // integer division by 2
r.x = Graphics.boxWidth - r.width >> 1; // horizontally centred
return r;
};
})();
maxLines method, or have the window resize itself when necessary.What do I change in this script to change the window size? Also I have the maxLines set to 4 in the core scripts, however it doesn't change the window size.
Okay I've used your plugin, and somehow the width of the box is exactly what I wanted it to be, but the height is still the same. How could I change that?
You can add a line to modify
r.height in the plugin code, e.g.
JavaScript:
Scene_Battle.prototype.logWindowRect = function() {
const r = alias.apply(this, arguments); // get original rect
r.width >>= 1; // integer division by 2
r.x = Graphics.boxWidth - r.width >> 1; // horizontally centred
r.height = this.calcWindowHeight(4, false); // 4 rows
return r;
};
Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-the-size-of-the-battle-log-window.173956/