Window_Base.prototype.drawFace = function(
faceName, faceIndex, x, y, width, height
) {
width = width || ImageManager.faceWidth;
height = height || ImageManager.faceHeight;
const bitmap = ImageManager.loadFace(faceName);
const pw = ImageManager.faceWidth;
const ph = ImageManager.faceHeight;
const sw = Math.min(width, pw);
const sh = Math.min(height, ph);
const dx = Math.floor(x + Math.max(width - pw, 0) / 2);
const dy = Math.floor(y + Math.max(height - ph, 0) / 2);
const sx = Math.floor((faceIndex % 4) * pw + (pw - sw) / 2);
const sy = Math.floor(Math.floor(faceIndex / 4) * ph + (ph - sh) / 2);
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
};
Window_Base.prototype.drawFace = function(
faceName, faceIndex, x, y, width, height
) {
width = width || ImageManager.faceWidth;
height = height || ImageManager.faceHeight;
const bitmap = ImageManager.loadFace(faceName);
const pw = ImageManager.faceWidth;
const ph = ImageManager.faceHeight;
const sw = Math.min(width, pw);
const sh = Math.min(height, ph);
const dx = Math.floor(x + Math.max(width - pw, 0) / 2);
const dy = Math.floor(y + Math.max(height - ph, 0) / 2);
const sx = Math.floor((faceIndex % 4) * pw + (pw - sw) / 2);
const sy = Math.floor(Math.floor(faceIndex / 4) * ph + (ph - sh) / 2);
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
};