After I changed the resolution, the UI became off-centered, and I don't seem to have scripts that change the X coordinate, so I would be glad, if someone could write one that could move the actor window (pretty sure I'm able to move the command and 'eyes' window).
MZ Changing the X coordinate of actor battle window
Javascript/Plugin SupportAfter I changed the resolution, the UI became off-centered, and I don't seem to have scripts that change the X coordinate, so I would be glad, if someone could write one that could move the actor window (pretty sure I'm able to move the command and 'eyes' window).
In your screenshot, the core windows (status and command) are centred. It's the custom "eyes" window that is off-centre.
Note that MZ implements 2 sizes (both found on the System 2 tab in the Database):
In MZ, the X position of the battle status window is based on the scene's
...or maybe something similar for
Note that MZ implements 2 sizes (both found on the System 2 tab in the Database):
- Screen Width/Height - this affects the game display size;
- UI Area Width/Height - this affects the area in which windows are placed in-game.
In MZ, the X position of the battle status window is based on the scene's
statusWindowX method. So I guess you'll need a plugin to patch that method to account for the width of your custom window? E.g. (untested):
JavaScript:
/*:
* @target MZ
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Scene_Battle.prototype.statusWindowX = function() {
const eyesWindowWidth = 123; // edit this line
return alias.apply(this, arguments) - (eyesWindowWidth >> 1);
};
})(Scene_Battle.prototype.statusWindowX);
statusWindowRect, e.g.
JavaScript:
/*:
* @target MZ
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Scene_Battle.prototype.statusWindowRect = function() {
const r = alias.apply(this, arguments);
const eyesWindowWidth = 123; // edit this line
r.x -= eyesWindowWidth >> 1; // subtract half, truncated to int
return r;
};
})(Scene_Battle.prototype.statusWindowRect);
I didn't realised it was off-centered because of 'eyes' window before, that kinda eases it. Thanks for help, it might be useful, if it proves an issue in the future.
Original thread: https://forums.rpgmakerweb.com/threads/changing-the-x-coordinate-of-actor-battle-window.176442/