8bitboy

Villager
Member
Joined
Jan 1, 2016
Messages
5
Reaction score
1
First Language
Portuguese (Br)
Primarily Uses
RMMV
Hello again, fellow makers.

This time I've been facing an issue that could probably be easily solved, but since I have almost no .js knowledge it has been a huge headscratcher...

I've decided to reduce the number of message rows from 4 to 3 (By using Yanfly's YEP_MessageCore) and at first sight, it looks pretty great!
But then, here comes the problem: The faces end up getting cropped in a weird way. See below:

1581793654911.png

I tried to follow the steps on this thread, but even though it solved my problem (more-or-less), the faces on the menu got a little bit stretched, so I gave up on that.

Now I only wanna know if there's a way for me to change the Y aspect of the face on the message window, so I don't have to manually edit every .png file manually (Since my game has lots of face files, it could be a very lenghty task).

Any help is appreciated!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,031
Reaction score
1,509
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi!
I did not test it, but maybe you can put this in a text file and save it as .js:

Code:
Window_Message.prototype.drawMessageFace = function() {
    this.drawFace($gameMessage.faceName(), $gameMessage.faceIndex(), X, Y);
    ImageManager.releaseReservation(this._imageReservationId);
};

By default, the X and Y are 0. I think if you put a negative value on Y, it will help.

But If I was you, I will change my png files instead of Js.
 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
280
Reaction score
308
First Language
English
Primarily Uses
RMMV
I'm assuming that by "change the Y aspect of the face" you mean that you want to change the height of the image (as opposed to the Y-coordinate), and still have it centered. If you take a look at the original code in rpg_windows.js, you can see the following:
Code:
// Original function in rpg_windows.js
Window_Message.prototype.drawMessageFace = function() {
    this.drawFace($gameMessage.faceName(), $gameMessage.faceIndex(), 0, 0);
    ImageManager.releaseReservation(this._imageReservationId);
};
Now, the drawFace function accepts an additional two arguments that are not seen above, but you can actually specify the exact width and height of the face image. So, for example, if I want to retain the face width but change the height from the default of 144 to 100, I just add that after the 0, 0 arguments of drawFace (FYI, the 0, 0 specify the X and Y-coordinates of the image, respectively):
Code:
// Override of the original function to add arguments for width and height
Window_Message.prototype.drawMessageFace = function() {
    this.drawFace($gameMessage.faceName(), $gameMessage.faceIndex(), 0, 0, Window_Base._faceWidth, 100);
    ImageManager.releaseReservation(this._imageReservationId);
};
So what you can do is copy the second block of code into a new plugin, and change Window_Base.faceWidth and the number 100 to whatever width and height you want. It should be compatible with YEP_MessageCore.js. This only affects the message window.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,879
Reaction score
14,702
First Language
English
Primarily Uses
RMVXA

I've moved this thread to JavaScript Support. Thank you.

 

Latest Threads

Latest Profile Posts

Chili: Evolved to taste spicy so no animal would eat them.

Humans: "Jokes on you ..."
I guess it becomes purely academic in less than four days but before then can anyone explain to me why the %^&*( animations in the MZ database don't have a 'Hue' slider??
Who here knows of the hidden laws of this multiverse? Such as the law of attraction
Exploding Fruits and Rasaks Pixelfarm Assets | RPG Maker News #108

So ghosts can go through walls and stuff, and depending their type (according to fantasy media) they can or can't interact with objects to a certain degree...

So why they don't always fall through floors? Do they always float and sometimes simulate walking? If things go through them how can they hear/see? And why sometimes they have clothing? Do clothes die as well?

Forum statistics

Threads
113,709
Messages
1,076,819
Members
147,729
Latest member
Mindseye_Co
Top