Help to change Dialog color

Dumber0

Newbie
Jul 27, 2017
39
37
hi all

no matter what i do i cant change the color


gui.rpy
## Colors ######################################################################
##
## The colors of text in the interface.

## An accent color used throughout the interface to label and highlight text.
define gui.accent_color = '#ff5a00'

## The color used for a text button when it is neither selected nor hovered.
define gui.idle_color = '#ffa300'

## The small color is used for small text, which needs to be brighter/darker to
## achieve the same effect.
define gui.idle_small_color = '#d4d4d4'

## The color that is used for buttons and bars that are hovered.
define gui.hover_color = '#ff5a00'

## The color used for a text button when it is selected but not focused. A
## button is selected if it is the current screen or preference value.
define gui.selected_color = '#ff5a00'

## The color used for a text button when it cannot be selected.
define gui.insensitive_color = '#404040'

## Colors used for the portions of bars that are not filled in. These are not
## used directly, but are used when re-generating bar image files.
define gui.muted_color = '#e0a366'
define gui.hover_muted_color = '#eac199'

## The colors used for dialogue and menu choice text.
define gui.text_color = '#FFD700' <------------- wont change
define gui.interface_text_color = '#FFD700' <------------- wont change


tried adding my own "font_size_and_color " rpy file, but that didnt help either.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,565
7,378
So, you didn't specify exactly WHAT text you were trying to change, so I'm going to give you the general-purpose solution.

Colors and sizes of text are determined by the style applied to the text. So, the first thing you should do is identify the specific style for the text you're trying to change. You can do that by hovering the mouse over some text and pressing Shift-I (capital I).

Once you've identified the style name, you can then find it in the Ren'py code. (Usually, it's going to be in screens.rpy. Using that, you can either manually modify the style definition, or work out which of the gui settings you need to change.

Personally, I tend to edit the styles manually rather than relying on the common settings, but that's an individual preference.

So - an example from "The Question":
1650303726310.png

I want to change the style of the narration text. So, I hover over it and press Shift-I
1650303786055.png

This shows me that the style in question is say_thought and that it's part of the screen on line 110 of screens.rpy. Looking in that file, I see:
Code:
style say_dialogue is default
style say_thought is say_dialogue
Which says that the say_thought style is a copy of the say_dialogue style, without any changes. If there were changes, you'd see something like the following:
Code:
style say_thought is say_dialogue:
    one or more statements here making changes from the say_dialogues style
Then we realize that the say_dialogue is a copy of the default style. So, we look up in the file and see
Code:
style default:
    properties gui.text_properties()
    language gui.language
The first line basically says, "grab all the properties that start with gui.text and stick them here. So this is how the lines you saw
Code:
define gui.text_color = '#ffffff'
get copied in.

Note that adding your own item to gui doesn't do any good, because Ren'py doesn't know about it.

So, in my specific case, I want to modify the style of the dialogue text without changing any of the other text. The easiest way to do that is to customize the style itself. So, I modify screens.rpy to say:
Code:
style say_dialogue is default:
    color "#ff0000"
style say_thought is say_dialogue
And, bingo, the text is red
1650304532906.png

Basically, understanding Ren'py's style system and how to modify individual styles gives you a LOT more control than trying to rely on the "gui system."
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Unfortunately, I'm going to have to reply with "it depends".

If altering gui.text_color isn't changing the shown text color, then the shown text is not using gui.text_color.

You'll need to backtrack a little to find what it is really using. The Style Inspector developer menu Rich has mentioned is a good start.
His explanation is better than what I was trying to type. So go with that.

What I would also point out is that it's possible to override the text color for each character that speaks. By doing something like...

define k = Character("Karen", what_color="#04B486")

You can also change the colors for non-character dialogue (not linked to a specific character), by adding your own narrator character (which is what RenPy auto-adds in the background for you).

define narrator = Character("", what_color="#FFFF66")

Both these examples use to override the defaults. It's more likely that someone did something with the default style statements. But I mention this, because it's also possible that it's this instead.

Finally there's also the very unlikely possibility that the line of dialogue you're looking at has text tags overriding things.
 
  • Like
Reactions: Dumber0 and Rich

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,565
7,378
What I would also point out is that it's possible to override the text color for each character that speaks. By doing something like...

...

Finally there's also the very unlikely possibility that the line of dialogue you're looking at has text tags overriding things.
Ya, all of that. LOL. I was working on the (possibly invalid) assumption that the OP was working on a game of their own based on the default Ren'py "game starter." But good to have those reminders for people who might be modding someone else's game.
 

Dumber0

Newbie
Jul 27, 2017
39
37
Unfortunately, I'm going to have to reply with "it depends".

If altering gui.text_color isn't changing the shown text color, then the shown text is not using gui.text_color.

You'll need to backtrack a little to find what it is really using. The Style Inspector developer menu Rich has mentioned is a good start.
His explanation is better than what I was trying to type. So go with that.

What I would also point out is that it's possible to override the text color for each character that speaks. By doing something like...

define k = Character("Karen", what_color="#04B486")

You can also change the colors for non-character dialogue (not linked to a specific character), by adding your own narrator character (which is what RenPy auto-adds in the background for you).

define narrator = Character("", what_color="#FFFF66")

Both these examples use to override the defaults. It's more likely that someone did something with the default style statements. But I mention this, because it's also possible that it's this instead.

Finally there's also the very unlikely possibility that the line of dialogue you're looking at has text tags overriding things.

Tnx for all the answers, ye it was a text TAG overriding things. Damn that mas annoying...spent so long looking for it.

Since i spend atlest 10hours everyday infront of a screen i have now trouble looking at (reading white text) so need to change it do something like gold #FFD700 really recomend it to ppl with the some problem.

and TNX to all of you once again!!

Edit: "You can do that by hovering the mouse over some text and pressing Shift-I (capital I)." anything special you have to do to get that to work??

to be set to True to operate. ?? i guess, well ill have something to figure out, have to learn it anyhow,
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
config.developer to be set to True to operate. ?? i guess, well ill have something to figure out, have to learn it anyhow,

When you run the game from the RenPy SDK launcher (i.e. during testing), it's automatically enabled (unless the game specifically overrides it during startup).

Most of us who modify existing games will switch it on within code before starting. For me, I have a script that sets various things for me. I would imagine other people might use UnRen's option "3" (Enable Console and Developer Menu) or alter the main script.rpy file.

This is my script file. I put it in the /game/ folder for every new game I play.
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

lyk5t

Member
Sep 25, 2021
132
45
hi all

no matter what i do i cant change the color


gui.rpy
## Colors ######################################################################
##
## The colors of text in the interface.

## An accent color used throughout the interface to label and highlight text.
define gui.accent_color = '#ff5a00'

## The color used for a text button when it is neither selected nor hovered.
define gui.idle_color = '#ffa300'

## The small color is used for small text, which needs to be brighter/darker to
## achieve the same effect.
define gui.idle_small_color = '#d4d4d4'

## The color that is used for buttons and bars that are hovered.
define gui.hover_color = '#ff5a00'

## The color used for a text button when it is selected but not focused. A
## button is selected if it is the current screen or preference value.
define gui.selected_color = '#ff5a00'

## The color used for a text button when it cannot be selected.
define gui.insensitive_color = '#404040'

## Colors used for the portions of bars that are not filled in. These are not
## used directly, but are used when re-generating bar image files.
define gui.muted_color = '#e0a366'
define gui.hover_muted_color = '#eac199'

## The colors used for dialogue and menu choice text.
define gui.text_color = '#FFD700' <------------- wont change
define gui.interface_text_color = '#FFD700' <------------- wont change


tried adding my own "font_size_and_color " rpy file, but that didnt help either.
Well, I want to cover a dialog text with white inside and black outline, how do I do this?
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,547
4,623
Well, I want to cover a dialog text with white inside and black outline, how do I do this?
I'd start by making my own topic and not performing necromancy on a thread that is 2 years dead.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Well, I want to cover a dialog text with white inside and black outline, how do I do this?

For an individual character:

define b = Character("Beth", color="#ba28eb", what_outlines=[ (3, "#000000", 0, 0) ])

The default color for dialogue text is usually white already, so that just adds a black outline (3 pixels wide).
If the dialogue isn't already white, then you could override that too:

define b = Character("Beth", color="#ba28eb", what_color = "#FFFFFF", what_outlines=[ (3, "#000000", 0, 0) ])


For most characters (aka all dialogue):

It (probably) already includes lines including...
Python:
# --- screens.rpy ---

style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos

Add an outlines parameter.

Python:
style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos
    outlines [ (3, "#000000", 0, 0) ]