I've messed around with this some more and have made some progress. However, I'm having an issue I'd like help with if possible. You see, I was able to get the textbox to resize. However, I want to make the namebox a separate window so that it won't get stretched with everything else. The resizing works when it's by itself, but once I add the namebox it gets all messed up. I've attached some screenshots.
Here's my code:
in screens:
Code: Select all
screen say(who, what):
window:
id "left"
style "left"
if who is "":
window:
id "namebox"
style "namebox"
text what id "what"
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
## Make the namebox available for styling through the Character object.
init python:
config.character_id_prefixes.append('namebox')
style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue
style namebox is default
style namebox_label is say_label
style left:
xalign 0.5
xfill True
yoffset 500
yminimum 91
background Frame("gui/textbox/n.png", left=5, top=0, right=5, bottom=50)
style window:
xalign 0.5
xfill True
yoffset 500
yminimum 91
background Frame("gui/textbox/n.png", left=5, top=0, right=5, bottom=50)
style namebox:
xalign .44
xfill False
yfill False
xsize gui.namebox_width
yalign -.107
ysize gui.namebox_height
background "gui/namebox.png"
style say_label:
properties gui.text_properties("name", accent=True)
xalign gui.name_xalign
yalign 0.5
style say_dialogue:
properties gui.text_properties("dialogue")
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
in gui:
Code: Select all
## The height of the textbox containing dialogue.
define gui.textbox_height = 91
define gui.textbox_width = 657
## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
## center, and 1.0 is the bottom.
define gui.textbox_yalign = 0.5
## The placement of the speaking character's name, relative to the textbox.
## These can be a whole number of pixels from the left or top, or 0.5 to center.
define gui.name_xpos = 144
define gui.name_ypos = 0
## The horizontal alignment of the character's name. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.name_xalign = 0.0
## The width, height, and borders of the box containing the character's name, or
## None to automatically size it.
define gui.namebox_width = 657
define gui.namebox_height = 217
## If True, the background of the namebox will be tiled, if False, the
## background of the namebox will be scaled.
#define gui.namebox_tile = True
## The placement of dialogue relative to the textbox. These can be a whole
## number of pixels relative to the left or top side of the textbox, or 0.5 to
## center.
define gui.dialogue_xpos = 130
define gui.dialogue_ypos = .1
## The maximum width of dialogue text, in pixels.
define gui.dialogue_width = 500
## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.dialogue_text_xalign = 0.0
And then the definitions used in the pictures. The n is the one with the nametag that is stretched out, ns does not have a nametag.
Code: Select all
$ n = Character("")
$ ns = Character(window_background="GUI/textbox/n.png", window_top_padding=100, window_bottom_padding=100, what_xpos=110, what_ypos=5)
Any help would be greatly appreciated.