Name Input Help/Plug-in/Advice

I’m in search for help/instructions on either, editing the “◆Name Input Processing” as a whole, or a plug-in that will let me change the “◆Name Input Processing”.

I’ve searched for about half a year and made a mess of the code breaking it more then not in attempt to get it to look, and function to how I want it too.

I’d wish to make it look like this concept art I made.

If anyone knows of a secret plug-in for MZ that I just couldn’t find, or is willing to make one, please let me know.

  • Thank you

Instead of editing the core Name Input code, try it as a separate MZ plugin so the original scene stays intact. Focus on restyling the window, repositioning your letter grid, and setting the character limit to match your concept.

I couldn’t find an MZ plugin that restyles the whole Name Input screen either, so I put together a small starter one based on your concept.

What I’d probably do is draw the checkered background, the title, the paper strip, and the white letter panel all into one picture, then hide the window frames and line the windows up on top of the art. The default letter grid is hard coded to 10 columns with Page and OK at the end, so the plugin also rewrites the cursor movement for 13 columns with OK in the bottom right.

Save this as CustomNameInput.js in your js/plugins folder and turn it on in the Plugin Manager:

/*:
 * @target MZ
 * @plugindesc Custom layout for the Name Input Processing screen (starter).
 * @help
 * Put your background art in img/pictures and set BACKGROUND below.
 * The window frames are hidden, so the art underneath shows through.
 * Move EDIT_RECT and INPUT_RECT until the text sits on your art.
 */
(() => {
    const BACKGROUND = "NameInputBG";        // img/pictures/NameInputBG.png
    const EDIT_RECT  = [30, 84, 240, 58];    // x, y, width, height of the name strip
    const INPUT_RECT = [14, 146, 266, 214];  // x, y, width, height of the letter grid (tall enough for 5 rows)
    const FONT_SIZE  = 18;
    const TEXT_COLOR = "#26403a";
    const ROW_GAP    = 10;                   // space between the uppercase and lowercase rows
    const LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
    const COLS = 13;
    const OK = LETTERS.length;               // index of the OK button

    // Background art instead of the blurred map, windows moved and see through
    Scene_Name.prototype.createBackground = function() {
        this._backgroundSprite = new Sprite(ImageManager.loadPicture(BACKGROUND));
        this.addChild(this._backgroundSprite);
    };
    Scene_Name.prototype.editWindowRect = () => new Rectangle(...EDIT_RECT);
    Scene_Name.prototype.inputWindowRect = () => new Rectangle(...INPUT_RECT);

    const _create = Scene_Name.prototype.create;
    Scene_Name.prototype.create = function() {
        _create.call(this);
        this._editWindow.opacity = 0;
        this._inputWindow.opacity = 0;
    };

    // Text style for both windows
    for (const W of [Window_NameEdit, Window_NameInput]) {
        W.prototype.lineHeight = () => FONT_SIZE + 10;
        W.prototype.resetFontSettings = function() {
            Window_Base.prototype.resetFontSettings.call(this);
            this.contents.fontSize = FONT_SIZE;
        };
        W.prototype.resetTextColor = function() {
            this.changeTextColor(TEXT_COLOR);
            this.changeOutlineColor("rgba(0, 0, 0, 0)");
        };
    }

    // Name strip: no face, letters start at the left edge
    Window_NameEdit.prototype.drawActorFace = function() {};
    Window_NameEdit.prototype.underlineColor = () => TEXT_COLOR;
    Window_NameEdit.prototype.itemRect = function(index) {
        const w = this.charWidth();
        return new Rectangle(index * w, 0, w, this.lineHeight());
    };

    // Letter grid: A to Z, a to z, then OK in the bottom right
    Window_NameInput.prototype.table = () => [[...LETTERS, "OK"]];
    Window_NameInput.prototype.maxCols = () => COLS;
    Window_NameInput.prototype.maxItems = () => OK + 1;
    Window_NameInput.prototype.itemWidth = function() {
        return Math.floor(this.innerWidth / COLS);
    };
    Window_NameInput.prototype.character = function() {
        return this._index < OK ? LETTERS[this._index] : "";
    };
    Window_NameInput.prototype.isPageChange = () => false;
    Window_NameInput.prototype.isOk = function() {
        return this._index === OK;
    };
    Window_NameInput.prototype.drawItemBackground = function() {};
    Window_NameInput.prototype.itemPadding = () => 0;

    Window_NameInput.prototype.itemRect = function(index) {
        const w = this.itemWidth();
        const h = this.itemHeight();
        if (index === OK) {
            return new Rectangle(w * (COLS - 2), h * 4 + ROW_GAP, w * 2, h);
        }
        const row = Math.floor(index / COLS);
        const gap = row >= 2 ? ROW_GAP : 0;
        return new Rectangle((index % COLS) * w, row * h + gap, w, h);
    };

    // Cursor movement for the new grid
    Window_NameInput.prototype.cursorDown = function(wrap) {
        if (this._index === OK) {
            if (wrap) this._index = COLS - 1;
        } else if (this._index >= OK - COLS) {
            this._index = OK;
        } else {
            this._index += COLS;
        }
    };
    Window_NameInput.prototype.cursorUp = function(wrap) {
        if (this._index === OK) {
            this._index = OK - 1;
        } else if (this._index >= COLS) {
            this._index -= COLS;
        } else if (wrap) {
            this._index = OK;
        }
    };
    Window_NameInput.prototype.cursorRight = function(wrap) {
        if (this._index === OK) return;
        if (this._index % COLS < COLS - 1) {
            this._index++;
        } else if (wrap) {
            this._index -= COLS - 1;
        }
    };
    Window_NameInput.prototype.cursorLeft = function(wrap) {
        if (this._index === OK) return;
        if (this._index % COLS > 0) {
            this._index--;
        } else if (wrap) {
            this._index += COLS - 1;
        }
    };
    Window_NameInput.prototype.processJump = function() {
        if (this._index !== OK) {
            this._index = OK;
            this.playCursorSound();
        }
    };
})();

Your background goes in img/pictures as NameInputBG.png. I lined the numbers up to your 640x360 concept, so if your game is a different size you’ll need to move EDIT_RECT and INPUT_RECT until the letters sit on your art.

This is pretty much perfect. The only little thing is the NameBox just having this quirk where the first three letters are smushed together and the last 3 are apart. I’m not sure if that’s due to me useing a bitmap font, or not though.

However all that matters is that it even works with the bitmap and doesn’t break due to the resolution, and all the other junk that fills up the name input.
I can’t thank you enough. Even if I now have another challange to tackle.

I think the spacing is my fault more than the font’s. The plugin makes each name slot exactly as wide as the letter A and starts the first one at the left edge, so the letters bunch up instead of landing on your red dashes. Each letter is also drawn from the left side of its slot, which is why thin letters like i and l leave uneven gaps.

Try swapping the Name strip section in CustomNameInput.js for this:

    // Name strip: fixed slots so the letters sit on the red dashes
    const NAME_X = 22;      // where the first slot starts
    const SLOT_WIDTH = 31;  // distance from one slot to the next
    Window_NameEdit.prototype.drawActorFace = function() {};
    Window_NameEdit.prototype.underlineColor = () => TEXT_COLOR;
    Window_NameEdit.prototype.itemRect = function(index) {
        return new Rectangle(NAME_X + index * SLOT_WIDTH, 0, SLOT_WIDTH, this.lineHeight());
    };
    Window_NameEdit.prototype.drawChar = function(index) {
        const rect = this.itemRect(index);
        this.resetTextColor();
        this.drawText(this._name[index] || "", rect.x, rect.y, rect.width, "center");
    };

I eyeballed NAME_X and SLOT_WIDTH from your screenshot, so you’ll probably need to nudge them until each letter sits over a dash.

It works! Genuinely, thank you! I was shocked that after all this time no one made a plugin for a more simple Name Input, but the fact you just did it with such speed shocks me. I mean the Name Input just breaks on smaller resolution games! Anyway, truly thank you.