[Solved] id "who" and id "what" overriding custom styles

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.
Post Reply
Message
Author
User avatar
SypherZent
Veteran
Posts: 362
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

[Solved] id "who" and id "what" overriding custom styles

#1 Post by SypherZent »

The "say" screen requires that text what and text who both contain the "id" parameter.

However, I have found that if I try to change the font, color, etc. within the "text" parameter inside the say screen itself, the "id" parameter overrides all of my settings.

Code: Select all

screen say:

    if who:
        text who:
            id "who"
            color "#ffffff"
            size 56

    text what:
        id "what"
        color "#111111"
        size 42
Here is a very basic example. I don't want the "id" parameter to override the custom styles I set in this screen because the game I am developing has dozens of styles and they must be dynamic. Ren'Py's static settings in gui.rpy are not good enough for what I need to accomplish.

However, the game breaks if I remove the "id" parameter. Text tags such as {w} no longer work or in the worst cases, the game simply crashes.

I need the "id" parameter to stop applying styles altogether and to stop affecting the custom style properties that I use in this screen.

How can I make the "id" parameter stop overriding my custom styles?
Last edited by SypherZent on Wed Apr 05, 2023 1:34 pm, edited 1 time in total.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: id "who" and id "what" overriding custom styles

#2 Post by _ticlock_ »

SypherZent wrote: Sun Mar 26, 2023 12:14 pm The "say" screen requires that text what and text who both contain the "id" parameter.

However, I have found that if I try to change the font, color, etc. within the "text" parameter inside the say screen itself, the "id" parameter overrides all of my settings.

Here is a very basic example. I don't want the "id" parameter to override the custom styles I set in this screen because the game I am developing has dozens of styles and they must be dynamic. Ren'Py's static settings in gui.rpy are not good enough for what I need to accomplish.

However, the game breaks if I remove the "id" parameter. Text tags such as {w} no longer work or in the worst cases, the game simply crashes.

I need the "id" parameter to stop applying styles altogether and to stop affecting the custom style properties that I use in this screen.

How can I make the "id" parameter stop overriding my custom styles?
I believe it only overwrites the styles if you provide a style when defining a character or provide a style using argument. So you can simply not specify styles when defining characters.

Also, if you temporarily want to change some `say` styles, a possibly better approach is to use `say` with style argument:

Code: Select all

"Red text" (what_color="#f00")

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2411
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: id "who" and id "what" overriding custom styles

#3 Post by Ocelot »

< < insert Rick Cook quote here > >

User avatar
SypherZent
Veteran
Posts: 362
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

Re: id "who" and id "what" overriding custom styles

#4 Post by SypherZent »

Thank you, Ocelot, that helps.

Post Reply

Who is online

Users browsing this forum: Google [Bot]