MZ Right-to-left or Arabic windows and text animation

Hello,

I'm just starting out with RMMZ and trying to make an Arabic language game. I tried to look for advice online (and AI had a couple of pieces of advice too) for flipping my boxes to be right-to-left.

Since I'm at the very genning I haven't gone too far just yet but here's my Options window from the title page:

rmmz arabic box.PNG


I'd like to figure out how to flip it so that OFF/ON/100%/etc are on the left side and put the Arabic text on the right.

Google's AI gave me the following:

Option 1: Use the VisuStella MZ Core Engine

If you are already using VisuStella plugins, this is the easiest method. The Core Engine plugin has a built-in feature to change the menu layout without writing any code.

  1. Open your project in RPG Maker MZ.
  2. Go to the Plugin Manager (Tools > Plugin Manager).
  3. Double-click the VisuMZ_0_CoreEngine plugin to open its parameters.
  4. Find the "Menu Layout Settings" parameter and expand it.
  5. Locate the entry for Scene_Menu and adjust the position parameters for the command window and other windows to place them on the right side of the screen.
I got that plugin but I didn't know how to change the parameters to make it work, especially for a title menu like the above.
It also gave me another option to make a custom .js to change windows RTL and I implemented it but it didn't seem to apply to a menu title item.
Option 2: Use custom JavaScript as a plugin

You can create a small, dedicated plugin with a single block of JavaScript code to override the default menu behavior.

  1. In your project's js/plugins folder, create a new file and name it something like RightToLeftMenu.js.
  2. Open the file in a text editor (like Notepad++ or VS Code) and add the following code:
    javascript
  • /*:
    * @target MZ
    * @plugindesc Changes menu layout for right-to-left input mode.
    * @author YourName
    * @help Free to use and/or modify for any project.
    */

    (function() {
    Scene_MenuBase.prototype.isRightInputMode = function() {
    return true;
    };
    })();

  • Save and close the file.
  • In RPG Maker MZ, open the Plugin Manager and add your new RightToLeftMenu.js plugin to your project.
  • Save your project and run a playtest. The change should be applied to the pause menu, status screens, and other default menus.

Does anyone know to flip that title menu item in the pic above? And moreover are there any dedicated plugins or tips to support RTL animated text or text direction aside from what was mentioned above?

Thanks and feel free to move this to another subforum if this isn't the right place to post this thread.
You'd want a plugin for this, so~

I've moved this thread to Plugin Requests (from MZ Support). Thank you.

For the options window layout, you could try this:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc RTL layout for options window.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/180349/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override - swap positions of status & title on each options item.
Window_Options.prototype.drawItem = function(index) {
    const title = this.commandName(index);
    const status = this.statusText(index);
    const rect = this.itemLineRect(index);
    const statusWidth = this.statusWidth();
    const titleWidth = rect.width - statusWidth;
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    // Changed the following lines.
    this.drawText(status, rect.x,               rect.y, statusWidth, "left");
    this.drawText(title,  rect.x + statusWidth, rect.y, titleWidth, "right");
};

And moreover are there any dedicated plugins or tips to support RTL animated text or text direction aside from what was mentioned above?
I'm not sure what you mean by "animated text". I wouldn't expect any plugin for text effects, like per-character fade-in for Show Text, to change where the text is drawn? 😅

The engine draws text by specifying an area and alignment, so you may need to address each case individually. Maybe someone else knows of a plugin for "full" RTL support.
You'd want a plugin for this, so~
Moved to: Plugin Requests (from MZ Support) For the options window layout, you could try this:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc RTL layout for options window.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/180349/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override - swap positions of status & title on each options item.
Window_Options.prototype.drawItem = function(index) {
    const title = this.commandName(index);
    const status = this.statusText(index);
    const rect = this.itemLineRect(index);
    const statusWidth = this.statusWidth();
    const titleWidth = rect.width - statusWidth;
    this.resetTextColor();
    this.changePaintOpacity(this.isCommandEnabled(index));
    // Changed the following lines.
    this.drawText(status, rect.x,               rect.y, statusWidth, "left");
    this.drawText(title,  rect.x + statusWidth, rect.y, titleWidth, "right");
};


I'm not sure what you mean by "animated text". I wouldn't expect any plugin for text effects, like per-character fade-in for Show Text, to change where the text is drawn? 😅

The engine draws text by specifying an area and alignment, so you may need to address each case individually. Maybe someone else knows of a plugin for "full" RTL support.
I appreciate the thread move!

And by that I don’t mean anything fancy. I meant just the dialogue text when it appears. I don’t know if the default state of text appearing in the boxes makes it scroll from left to right letter by letter or if The Who text just appears all at once. But if the text does scroll into existence I’m wondering if it’ll automatically scroll from right to left with the code I’ve implemented of I need to do something else to fix it.

I could also be using the wrong terminology so forgive me. I just meant the way text comes up normally that you have to move through just like in old Pokemon or FF games:

Original thread: https://forums.rpgmakerweb.com/threads/right-to-left-or-arabic-windows-and-text-animation.180349/