- Jun 12, 2022
- 135
- 186
I am going through the RenPy docs and the tutorial code one thing is confusing for me is how the styles are associated with displayables, you have the say screen like this
Then the style window is defined like this
I am guessing that the Window automatically gets the style from "window"? Can I manually override to a different style name like
This does not actually seem to work or override the style to newstyle. What am I misunderstanding?
Python:
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
style "namebox"
text who id "who"
text what id "what"
Python:
style window is default
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)
Python:
screen say(who, what):
style_prefix "say"
window:
id "window"
style "newstyle" # This is where I override the name
if who is not None:
window:
style "namebox"
text who id "who"
text what id "what"
style newstyle is default
style newstyle:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/textbox2.png", xalign=0.5, yalign=1.0)