adding padding to dialogue box

adilene

Regular
Regular
Joined
Jul 3, 2023
Messages
60
Reaction score
5
First Language
Spanish
Primarily Uses
RMMZ
Hello, I am wondering how I can add padding around the text in a dialogue box. I found the following code but it only works for width, not height. How do I go about adding padding to all sides?
Code:
Window_Message.prototype.newLineX = function(textState) {
const faceExists = $gameMessage.faceName() !== "";
const faceWidth = ImageManager.faceWidth;
const spacing = 20;
const margin = faceExists ? faceWidth + spacing : 50;
return textState.rtl ? this.innerWidth - margin : margin;
};
Here's a screenshot of my current dialogue box setup. The text isn't padded.
Screenshot 2023-07-13 212008.png
 

Kenen

Regular
Regular
Joined
Apr 3, 2012
Messages
546
Reaction score
958
First Language
English
Primarily Uses
RMMZ
Windows have a padding property that you can adjust. Failing that, you could dive deeper and make adjustments to how the window(s) render individual lines of text.

That being said, based on your screenshot and depending upon how much code you want to tweak, I might humbly suggest being careful in terms of how you plan the graphical design of your windows. You can certainly position things however you like with enough code adjustments, but unless you plan your designs within the general scope of how MZ renders windows, you'll likely need to adjust more than just the padding value.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,266
Reaction score
1,700
First Language
English
Primarily Uses
RMMV
That's strange. I tried using the plugin but the window padding remains the same. I checked the console and this message popped up.
View attachment 269360
That error suggests something wrong with what was put inside the curly braces in the parameters or how the inputs were formatted. There may be a missing comma or quotation mark, etc

@Eliaquim
 
Last edited:

Eliaquim

Hakuen Studio
Regular
Joined
May 22, 2018
Messages
3,362
Reaction score
2,671
First Language
Portuguese - Br
Primarily Uses
RMMZ
That's strange. I tried using the plugin but the window padding remains the same. I checked the console and this message popped up.
View attachment 269360
Hi!

As I can see on the erro trance, It seems that something is wrong with the plugin parameters that let you set the window position.
Please, open the plugin manager and check out those parameters to see if everything is filled properly.
 

adilene

Regular
Regular
Joined
Jul 3, 2023
Messages
60
Reaction score
5
First Language
Spanish
Primarily Uses
RMMZ
Hi!

As I can see on the erro trance, It seems that something is wrong with the plugin parameters that let you set the window position.
Please, open the plugin manager and check out those parameters to see if everything is filled properly.
Hello, it seems there may be an error with the code. I think there are parameters missing.
Screenshot 2023-07-14 002449.png
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,266
Reaction score
1,700
First Language
English
Primarily Uses
RMMV
Have you tried clicking those parameters and editing them?
 

adilene

Regular
Regular
Joined
Jul 3, 2023
Messages
60
Reaction score
5
First Language
Spanish
Primarily Uses
RMMZ
Have you tried clicking those parameters and editing them?
I have! The padding: 50 is what I edited. The default padding is 12 iirc. Nothing shows up in game and the error message pops up in the console. I'm guessing it's an error in the code.
 

Eliaquim

Hakuen Studio
Regular
Joined
May 22, 2018
Messages
3,362
Reaction score
2,671
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hello, it seems there may be an error with the code. I think there are parameters missing.
View attachment 269365
There is no error. You need to click on the parameters and edit/fill them:
  • Top Settings
  • Center Settings
  • Bottom Settings

Everytime you install a plugin on your project, you need to read the help file to understand how the parameters works and open the plugin manager and make sure you setup everything. Those three parameters, the user must setup them.
 

adilene

Regular
Regular
Joined
Jul 3, 2023
Messages
60
Reaction score
5
First Language
Spanish
Primarily Uses
RMMZ
There is no error. You need to click on the parameters and edit/fill them:
  • Top Settings
  • Center Settings
  • Bottom Settings

Everytime you install a plugin on your project, you need to read the help file to understand how the parameters works and open the plugin manager and make sure you setup everything. Those three parameters, the user must setup them.
My bad, I assumed the parameters were automatically set up! I thought it was a code error. I got it to work, thank you so much :]
Edit: Actually nevermind
 
Last edited:

WhyIamaPotato

Professional dude
Member
Joined
Jan 13, 2020
Messages
27
Reaction score
2
First Language
French
Primarily Uses
RMMZ
There is no error. You need to click on the parameters and edit/fill them:
  • Top Settings
  • Center Settings
  • Bottom Settings

Everytime you install a plugin on your project, you need to read the help file to understand how the parameters works and open the plugin manager and make sure you setup everything. Those three parameters, the user must setup them.
I tried your plugin and got error messages as well. Mine says ''Type Error this.updateHorizontalOpenness is not a function''. Do I have to write something in the original JS code?
 

Attachments

  • type-error.JPG
    type-error.JPG
    44.5 KB · Views: 1

Latest Posts

Latest Profile Posts

Help, I can't stop! :kaohi:

alice_ornament.png
I'm happy to join this community.
about this argument. I expressed myself badly, I did it on my own, my English was mixed with Google Translate. And I believe chatGPT didn't even exist in 2016
I have to take sleeping pills :rtear:
Now that the forum is running smoothly, I can run around and react to posts the millisecond they're posted.
patrick-star-spongebob.gif

Forum statistics

Threads
136,812
Messages
1,270,316
Members
180,574
Latest member
PastorGary
Top