MZ Message Window, Name Padding

When editing a dialogue windows' content, you have the option of writing a name (or more) which appears above the textbox of narration/dialogue. Natively, the frame appears too close to the name. I understand that this might be a ME problem due to the thick frame style I chose to use. So, Ive been "forcing" the padding manually by adding double space before and another double space after the name—or something like that.


Would it be possible to have that automated/adjustable instead via a plugin? This is so "first world problem" it wouldnt bother me if not possible in the slightest. Its just a minor inconvenience. Ive attached a screenshot (which includes my FORCED double-space before and after applied). Thanks!
I would look at Hakuen Studio's MZ plugins. He has a lot that deal with message boxes.
From your description, it sounds like you want to add just horizontal padding. You can try the following simple edits to see if they work to your liking. Copy and paste the following into a new .js file in your plugins folder, and try placing it before any message plugins you may have.

The second change is to keep the text centered, it's just half of whatever number is added in the first function.

Code:
Window_NameBox.prototype.windowWidth = function() {
    if (this._name) {
        const textWidth = this.textSizeEx(this._name).width;
        const padding = this.padding + this.itemPadding();
        const width = Math.ceil(textWidth) + padding * 2 + 12;  // Change 12 to any number you want
        return Math.min(width, Graphics.boxWidth);
    } else {
        return 0;
    }
};

Window_NameBox.prototype.refresh = function() {
    const rect = this.baseTextRect();
    this.contents.clear();
    this.drawTextEx(this._name + 6, rect.x, rect.y, rect.width);  // Change 6 accordingly
};
@SeaPhoenix That's correct, horizontal was my intention. And TY for specifying plugin order. Ill copy that into a .js and ill try it later tonight or tomorrow. Thanks ahead of time.

@AquaEcho Will do, ty.
I just tried it, Phoenix! Is this normal? Thats with values unedited (unless I did something wrong without noticing it). It seems the "6" from "+ 6" adds the character next to the name. Also tried it placed on top of the plugin list, just in case. Edited my message a few times & added a screenshot to clarify.
BUMP.
BUMP. Tried one by GabeMZ in the meantime and it wasnt that great (though it might be a mistake on my part)..
In the plugin you were given, change the +6 from the this._name to rect.x
Took a bunch of trials and errors as I misinterpreted what you meant. I went in many directions, but of course, the last one was the correct one. It was just about moving the "+6." Thanks! <3

Nini & Gwen.PNG

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/message-window-name-padding.180028/