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.
init python:
def calculate_window_style(who):
return "window1" if who is 0 else "window"
python:
window_style = calculate_window_style(who)
screen say(who, what):
style_prefix "say"
python:
window_style = calculate_window_style(who)
window:
id "window"
style window_style
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
init python:
config.character_id_prefixes.append('namebox')
style window is default
style window1 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 window:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
style window1:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/UI111.png", xalign=0.5, yalign=1.0)