MV Looking for a small plugin regarding face graphics

So I've been trying to use 48 x 48 in my game. And while it "somewhat" works, there are issues. Namely the faces being cut off at the bottom. I've tried everything from changing the face size in the yanfly params to adjusting line heights.

Adjusting the line height to 48 x 48 will fix the face being cut off, but introduce text allignment issues with pretty much everything else. From choices (Visual Novel Choices plugin) to the message boxes just ending up too big.

Face being cut off:
1732990583436.png

Face not being cut off with 2 line text:
1732990640095.png

There's clearly enough space for the face, but no options to adjust the placement of it. Even setting all the window and font buffers to 0 doesn't help. (Which again, would just introduce problems with everything else.

So my request would be as follows:
A small plugin that ensures the full face graphic is drawn, regardless of window size, line height, font size, buffers or anything else really. (And maybe move the face up a few pixels, so it's more like this:

1732990882857.png
What Yanfly params in which plugin? If it correctly modifies Window_Base._faceWidth and _faceHeight, it should automatically work with all the other calculations for how much space the face takes up in the message window.

Have you tested with no plugins active except the one that's modifying the face size? There may be something else overwriting or modifying it again.
It's not that the calculations are incorrect. It's just that the face graphics seem to only be drawn within the confines of the window height minus buffer space, which is why I'm asking for a plugin that let's the face graphic ignore those confines.

With my line height being only 36, but the face being 48, it's not too surprising this happens on a one line box.

As a sanity check, here the result without anything but core engine, message core, and extended message pack one:
1732992312520.png
It's not that the calculations are incorrect. It's just that the face graphics seem to only be drawn within the confines of the window height minus buffer space, which is why I'm asking for a plugin that let's the face graphic ignore those confines.

With my line height being only 36, but the face being 48, it's not too surprising this happens on a one line box.
So, to be clear, the basic question/problem has nothing to do with the size of the face, it's the fact that you're making the message window smaller. You would see this with the default face graphics if you forced the message window to not draw its normal size.

You can try changing line 1201 of the Message Core to read:
Code:
this.height = Max.max(Math.min(this.windowHeight(), Graphics.boxHeight), this._faceHeight + this.standardPadding() * 2);

That should prevent you from sizing the window smaller than the area it needs to display the face.
Yes, I suppose that's kinda the crux of it. I guess I was kinda expecting the face size params to handle that. Your code line is nice, but ultimately the opposite of what I want. I don't want the message box to become higher? than it is right now, I want the face section to just ignore all that and render the face graphic no matter what.

If I wanted to prevent the box from being smaller than the face space, I'd just make it bigger.
Your code line is nice, but ultimately the opposite of what I want. I don't want the message box to become higher? than it is right now, I want the face section to just ignore all that and render the face graphic no matter what.
So you want the face to be overlapping the borders of the window? That would require a more substantial plugin, because you'd have to remove the face as a part of the message window's contents and draw it as a separate sprite on top.

I'm not finding the example in the OP super helpful for what you want because the face in that image is clearly smaller than the face that's getting cut off in the first image.
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Change drawFace to scale instead of crop in small areas.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/173578/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
"use strict";
  /** Identifier for new "newLineX offset" property on `Window_Message`. */
  const P = "_offsetNewLineX";

  /** Identifier for new "store newLineX offset" method on `Window_Base`. */
  const MoX = "makeOffsetNewLineX";

  /** If `true`, paint without smoothing/interpolation. */
  const PIXELATE = false;

  /** If `true`, scale target size to powers of 2 only. */
  const POW2 = true;

  /** @abstract */
  Window_Base.prototype[MoX] = function(v) {};

  /** @param {number} v Value to store for `newLineX` offset. */
  Window_Message.prototype[MoX] = function(v) {
    const t = this._textState;
    this[P] = v;
    t.x = t.left = this.newLineX();
  };

  // Override - scale face to fit given area, rather than crop it.
  Window_Base.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
    // load face, get source width/height
    const bmp = ImageManager.loadFace(faceName);
    const pw = Window_Base._faceWidth;
    const ph = Window_Base._faceHeight;
    // limit width/height by window contents
    width  = Math.min(width  || pw, this.contents.width  - x);
    height = Math.min(height || ph, this.contents.height - y);
    // always source full face size
    const sw = pw;
    const sh = ph;
    // determine destination size (2 options)
    let dw = Math.max(0, sw);
    let dh = Math.max(0, sh);
    if (POW2) {  // power-of-2
      while (dw > width || dh > height)
        dw >>= 1, dh >>= 1;
    } else {     // nearest int, retain ratio
      if (dw > width || dh > height) {
        const z = Math.min(width / dw, height / dh);
        dw *= z;
        dh *= z;
      }
    }
    this[MoX](width - dw);
    // destination coords
    const dx = Math.floor(x);
    const dy = Math.floor(y + (height - dh) / 2);
    // source coords as usual
    const sx = faceIndex % 4 * pw + (pw - sw) / 2;
    const sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
    // paint
    if (PIXELATE) {
      this.contents._context.save();
      this.contents._context.imageSmoothingEnabled = false;
    }
    this.contents.blt(bmp, sx, sy, sw, sh, dx, dy, dw, dh);
    if (PIXELATE)
      this.contents._context.restore();
  };

  // Patch - apply stored newLineX offset.
  void (function(alias) {
    Window_Message.prototype.newLineX = function() {
      return alias.apply(this, arguments) - (this[P] || 0);
    };
  })(Window_Message.prototype.newLineX);

  // Patch - clear stored newLineX offset with other flags.
  void (function(alias) {
    Window_Message.prototype.clearFlags = function() {
      alias.apply(this, arguments);
      delete this[P];
    };
  })(Window_Message.prototype.clearFlags);

})();
Yeah I noticed that too, tho it shouldn't. But yeah, I essentially just want the face to ignore any buffers and line heights, mainly because it's clearly small enough to not cross any window borders.

and there goes @caethyril just dropping code without a word lmao
It's the quiet ones you have to watch out for @SGHarlekin
'Nuff said. 😮‍💨

I did some basic tests with it, but I don't know whether it'll conflict with Yanfly's plugins (or whatever else you may be using). Not totally sure whether it's quite what you wanted, either. Was a fun puzzle, though! 👋
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Change drawFace to scale instead of crop in small areas.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/173578/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
"use strict";
  /** Identifier for new "newLineX offset" property on `Window_Message`. */
  const P = "_offsetNewLineX";

  /** Identifier for new "store newLineX offset" method on `Window_Base`. */
  const MoX = "makeOffsetNewLineX";

  /** If `true`, paint without smoothing/interpolation. */
  const PIXELATE = false;

  /** If `true`, scale target size to powers of 2 only. */
  const POW2 = true;

  /** @abstract */
  Window_Base.prototype[MoX] = function(v) {};

  /** @param {number} v Value to store for `newLineX` offset. */
  Window_Message.prototype[MoX] = function(v) {
    const t = this._textState;
    this[P] = v;
    t.x = t.left = this.newLineX();
  };

  // Override - scale face to fit given area, rather than crop it.
  Window_Base.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
    // load face, get source width/height
    const bmp = ImageManager.loadFace(faceName);
    const pw = Window_Base._faceWidth;
    const ph = Window_Base._faceHeight;
    // limit width/height by window contents
    width  = Math.min(width  || pw, this.contents.width  - x);
    height = Math.min(height || ph, this.contents.height - y);
    // always source full face size
    const sw = pw;
    const sh = ph;
    // determine destination size (2 options)
    let dw = Math.max(0, sw);
    let dh = Math.max(0, sh);
    if (POW2) {  // power-of-2
      while (dw > width || dh > height)
        dw >>= 1, dh >>= 1;
    } else {     // nearest int, retain ratio
      if (dw > width || dh > height) {
        const z = Math.min(width / dw, height / dh);
        dw *= z;
        dh *= z;
      }
    }
    this[MoX](width - dw);
    // destination coords
    const dx = Math.floor(x);
    const dy = Math.floor(y + (height - dh) / 2);
    // source coords as usual
    const sx = faceIndex % 4 * pw + (pw - sw) / 2;
    const sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
    // paint
    if (PIXELATE) {
      this.contents._context.save();
      this.contents._context.imageSmoothingEnabled = false;
    }
    this.contents.blt(bmp, sx, sy, sw, sh, dx, dy, dw, dh);
    if (PIXELATE)
      this.contents._context.restore();
  };

  // Patch - apply stored newLineX offset.
  void (function(alias) {
    Window_Message.prototype.newLineX = function() {
      return alias.apply(this, arguments) - (this[P] || 0);
    };
  })(Window_Message.prototype.newLineX);

  // Patch - clear stored newLineX offset with other flags.
  void (function(alias) {
    Window_Message.prototype.clearFlags = function() {
      alias.apply(this, arguments);
      delete this[P];
    };
  })(Window_Message.prototype.clearFlags);

})();
Well, I just popped it in and...
1732999329563.png

I guess half the face is no longer accurate xD

Perhaps I should clarify once more. I do not want to scale my face graphic. I simply want the face graphic to render regardless of the window height/ line height.
Ohhh. Oops. Sorry, I think I was misled by that last screenshot, the one with the smol face in the corner. 😴

I think you'll need something to rework the face image into a separate sprite, like Turan said:
That would require a more substantial plugin, because you'd have to remove the face as a part of the message window's contents and draw it as a separate sprite on top.
Usually the face is blitted onto the window's contents canvas, which (as you've seen) stops short of the window borders. But I imagine resizing that could cause all kinds of weirdness. 👋

Have you considered a plugin like Galv's Message Busts?
Ohhh. Oops. Sorry, I think I was misled by that last screenshot, the one with the smol face in the corner. 😴

I think you'll need something to rework the face image into a separate sprite, like Turan said:

Usually the face is blitted onto the window's contents canvas, which (as you've seen) stops short of the window borders. But I imagine resizing that could cause all kinds of weirdness. 👋

Have you considered a plugin like Galv's Message Busts?
Well, judging by the page alone, he doesn't mention the ability to define where exactly that bust is going to be displayed aside from "On top of message box or bottom of screen" as well as "left or right", so I'm not entirely sure this would work, but I'll give it a shot.
There's a plugin parameter to display the bust at the bottom of the screen. So you would either size up the canvas of your face files that you put in the bust folder so that they appear in the correct spot, or ask someone to help you change the screen coordinates of where the "on the bottom" busts are drawn.
I did put together this little plugin:
Spoiler: some different plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Always show full message face, as a sprite.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/173578/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
"use strict";
  /** Identifier for new sprite property on `Window_Message`. */
  const P = "_messageFaceSprite";

  // Override - use sprite instead of painting to canvas.
  Window_Message.prototype.drawFace = function(faceName, faceIndex, x, y, w, h) {
    this[P].bitmap = ImageManager.loadFace(faceName);
    const fw = Window_Base._faceWidth  || ImageManager.faceWidth;
    const fh = Window_Base._faceHeight || ImageManager.faceHeight;
    w || (w = Math.min(this.contents.width,  fw));
    h || (h = Math.min(this.contents.height, fh));
    const p  = this.padding;
    const sw = fw;
    const sh = fh;
    const sx = (faceIndex %  4) * fw;
    const sy = (faceIndex >> 2) * fh;
    const dx = x + w - (sw >> 1) + p;
    const dy = y + h - (sh >> 1) + p;
    this[P].setFrame(sx, sy, sw, sh);
    this[P].move(dx, dy);
  };

  // Patch - create sprite for displaying face.
  void (alias => {
    Window_Message.prototype.initialize = function() {
      alias.apply(this, arguments);
      const s = this[P] = new Sprite();
      s.anchor.set(0.5);
      this.addChild(s);
    };
  })(Window_Message.prototype.initialize);

})();
It's a bit rough around the edges, though, e.g. the face sprite only updates when a new message starts, so it will continue to show while the window is closing/opening. Also, as before, the position might not be what you want. Should be pretty good in terms of compatibility with other plugins, though.

However, I think an established plugin like Galv's is likely be a more reliable solution. 👋
Thanks for that! I gave the thing a shot, and yeah, the sprite staying visible during the closing of the box is a bit unfortunate, but works pretty great otherwise.

I had a chat with my coder, and I'll be getting something from him that suits my needs. (It was pretty late, so I forgot to update this thread, sorry!)
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-small-plugin-regarding-face-graphics.173578/