[Solved] Say Text Window Has Inconsistent Width
Posted: Tue Oct 16, 2018 6:40 pm
I seem to have encountered a rather vexing situation. As attachments V1 and V2 show, I have carefully designed the say window for text to be positioned exactly 12 pixels (using integers) from each of the internal borders. However, if there is too much text (as V3 shows), the right side of the text ends up extending almost to the edge of the right border.
I've tried extending window sizes, turning off Justify, adding margins, but nothing I do seems to work and it is starting to leave me really disheartened. Below is what I believe to be the relevant code. If anyone is able to solve this dilemma, I will be eternally grateful. <3
I've tried extending window sizes, turning off Justify, adding margins, but nothing I do seems to work and it is starting to leave me really disheartened. Below is what I believe to be the relevant code. If anyone is able to solve this dilemma, I will be eternally grateful. <3
#########################################
## These settings let you customize the window containing the
## dialogue and narration, by replacing it with an image.
## The background of the window. In a Frame, the two numbers
## are the size of the left/right and top/bottom borders,
## respectively.
style.window.background = Frame("transparent.png", 0, 0)
## Margin is space surrounding the window, where the background
## is not drawn.
style.window.left_margin = 0
style.window.right_margin = 0
style.window.top_margin = 0
style.window.bottom_margin = 0
## Padding is space inside the window, where the background is
## drawn.
style.window.left_padding = 0
style.window.right_padding = 0
style.window.top_padding = 0
style.window.bottom_padding = 0
## This is the minimum height of the window, including the margins
## and padding.
style.window.xpos = 0.235
style.window.ypos = 0.136
style.window.xsize = 0.62
style.window.ysize = 0.3
style.window.xminimum = 0.621
style.window.xmaximum = 0.621
style.window.yminimum = 0.3
style.window.ymaximum = 0.3
##############################################################################
# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say(who, what, side_image=None, two_window=False):
# Decide if we want to use the one-window or two-window variant.
if not two_window:
# The one window variant.
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"
else:
# The two window variant.
vbox:
style "say_two_window_vbox"
if who:
window:
style "say_who_window"
text who:
id "who"
window:
id "window"
pos 0.03
has vbox:
style "say_vbox"
text what id "what"
# If there's a side image, display it above the text.
if side_image:
add side_image
else:
add SideImage() xalign 0.5 yalign 0.5
# Use the quick menu.
use quick_menu
style nvl_dialogue:
justify True
xpos (0.07)
style say_dialogue:
justify True
xpos (0.07)