Hi can someone help me to figure out this?
I'm also new on RM MZ.😅
I'm also new on RM MZ.😅
Window_GameEnd (like most other command windows) is centre-aligned by default (itemTextAlign). Are you sure you're using RPG Maker MZ?/*:
* @target MZ
* @url https://forums.rpgmakerweb.com/threads/162024/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Window_Options.prototype.addCommand = function(name, symbol) {
if (symbol !== "touchUI")
alias.apply(this, arguments);
};
})(Window_Options.prototype.addCommand);
void (alias => {
Scene_Options.prototype.maxCommands = function() {
return alias.apply(this, arguments) - 1;
};
})(Scene_Options.prototype.maxCommands);
void (alias => {
ConfigManager.applyData = function() {
alias.apply(this, arguments);
this.touchUI = false;
};
})(ConfigManager.applyData);
Hi, thanks for the response, I wanted to clarify that I'm actually working on an completely evented menu and I have to simulate the game end scene with choices and I wanna centre the text… think I will add more choices tho.
(window width - text width) / 2/*:
* @target MZ
* @plugindesc Centre-aligned choices.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/162024/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Window_ChoiceList.prototype.drawItem = function(index) {
const rect = this.itemLineRect(index);
const cmd = this.commandName(index);
const dx = Math.floor(rect.width - this.textSizeEx(cmd).width) / 2;
this.drawTextEx(cmd, rect.x + dx, rect.y, rect.width);
};
})(Window_ChoiceList.prototype.drawItem);
dx calculation to depend on rect.width instead of this.innerWidth.Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-centre-the-text-for-choice-window-and-how-can-i-completely-disable-mobile-buttons.162024/