Text misaligning in say box when there is 1 or 2 lines

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Vodka
Regular
Posts: 33
Joined: Sun Apr 29, 2012 10:53 pm
Contact:

Text misaligning in say box when there is 1 or 2 lines

#1 Post by Vodka »

I have noticed that the text in my textbox seems to shift up/down one pixel depending on whether a panel of dialogue is 1 or 2 lines. It's not a major issue, but is a little annoying.

I am using a custom textbox for the say window, by the way. Is there some text specific variable that can fix this? Here is my relevant code.

style.window.background = "ui/window.png"

## Margin is space surrounding the window, where the background
## is not drawn.

style.window.left_margin = 260
style.window.right_margin = 260

## Padding is space inside the window, where the background is
## drawn.

style.window.left_padding = 80
style.window.right_padding = 100
style.window.top_padding = 75
style.window.bottom_padding = 20


## This is the minimum height of the window, including the margins
## and padding.

style.window.yminimum = 256

Vodka
Regular
Posts: 33
Joined: Sun Apr 29, 2012 10:53 pm
Contact:

Re: Text misaligning in say box when there is 1 or 2 lines

#2 Post by Vodka »

Looking through the renpy stuff, it seems there is some property for padding between lines of text, which seems to be the only thing that could be causing this.

What I believe is happening right now:
- There is some property for text that 'pads' above a line
- The pad for line 1 is either 0 or some set value
- When the dialogue creates line 2, it either adds to the line 1 value or sets it something other than 0

Vodka
Regular
Posts: 33
Joined: Sun Apr 29, 2012 10:53 pm
Contact:

Re: Text misaligning in say box when there is 1 or 2 lines

#3 Post by Vodka »

Yep, found it: line_leading

style.default.line_leading = 12

The above code fixes the problem, I'm not sure if I'm the only one that was having it. 12 seems to be the default value for the variable, but I'm not sure why it wasn't 'sticking' until I set it myself. I'll leave this thread open in case anyone else runs into this.

Post Reply

Who is online

Users browsing this forum: babayi0827, Majestic-12 [Bot], Semrush [Bot]