Help with cropping faces/changing face Y position in message windows!

8bitboy

Warper
Member
Joined
Jan 1, 2016
Messages
4
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
1,564
Reaction score
912
First Language
Portuguese - Br
Primarily Uses
RMMV
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
234
Reaction score
207
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,367
Reaction score
14,072
First Language
English
Primarily Uses
RMVXA

I've moved this thread to JavaScript Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Ami
--- Friendship System ---

(F.Mage and F.Healer's FP is 100)
F.Mage: We did it! we can beat the monster easily!
F.Healer: With the Friendship System,we got stronger thanks to you F.Mage (Hugging)
F.Mage: (Blushing) Ahh...don't say like that. we are Best Friend Forever.
(In Distand)
M.Mage: They look happy...
M.Healer: Yeah...always like that...
This new screen transfer looks wild! :LZSexcite:


Stream will be live shortly with a session of the Interactive Text Adventure!

Forum statistics

Threads
103,281
Messages
998,564
Members
134,784
Latest member
Denzen
Top