How is say_label overriding my custom style when I've already removed it from everywhere?
Posted: Thu Sep 23, 2021 11:06 am
I was trying to replicate the solution that was given to me in my previous post that changes the properties of text through a custom style. It turned out to be simple, specify a style "style_name" after the text. It then inherits the properties within the style_name, simple and makes sense.
I encountered another problem, however, when I tried to make a new project, this time just editing out parts of the code. I made a custom style, made the text who inherit properties from that style by adding style "nameStyle_t" and deleted the rest of the unused Say Screen code.
I ran it, and the display remained unchanged. I inspected the text and saw this:
So then I replaced all instances of say_label in every text file in the game folder with nameStyle or even nameStyle_t, cleaned up some code relating to say_label. I even tried to change the default window properties just in case. Every single time, the text still inherited properties from this should be non existent say_label style. I am admittedly frustrated. It just doesn't make sense why it would completely ignore the style I assigned to it and instead follow something that does not even exist anywhere in the code.
In the middle of writing this post I was surprisingly able to find a "solution" by making say_label inherit nameStyle_t. Like so, in case some poor soul stumbles upon this problem in the future:
However, I am still at a loss as to why and how the nonexistent style say_label managed to override the custom style I assigned to it. I would greatly appreciate it if someone is able to answer my question.
I encountered another problem, however, when I tried to make a new project, this time just editing out parts of the code. I made a custom style, made the text who inherit properties from that style by adding style "nameStyle_t" and deleted the rest of the unused Say Screen code.
Code: Select all
screen say(who, what):
window:
if who is not None:
window:
id "name"
style "nameStyle"
text who id "who" style "nameStyle_t"
text what id "what" style "sayStyle_t"
## 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('nameStyle')
style window:
xanchor 0
yanchor 0
xpos 410
ypos 743
background Image("gui/textbox.png")
style nameStyle:
xanchor 0
yanchor 0
yoffset 15
xoffset 40
style nameStyle_t:
properties gui.text_properties("nameStyleGUI")
size 78
style sayStyle:
xanchor 0
style sayStyle_t:
size 78
So then I replaced all instances of say_label in every text file in the game folder with nameStyle or even nameStyle_t, cleaned up some code relating to say_label. I even tried to change the default window properties just in case. Every single time, the text still inherited properties from this should be non existent say_label style. I am admittedly frustrated. It just doesn't make sense why it would completely ignore the style I assigned to it and instead follow something that does not even exist anywhere in the code.
In the middle of writing this post I was surprisingly able to find a "solution" by making say_label inherit nameStyle_t. Like so, in case some poor soul stumbles upon this problem in the future:
Code: Select all
style say_label is nameStyle_t