RenPy shadow or outline text

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,943
Anyone know if it's possible to outline or add shadow to text in RenPY? It appears one can however im not catching what they are saying. Using ATOM as my editor.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,199
You can do this by using the style property. Something like this :

Code:
style say_dialogue:
    outlines [ ( 0, "#0F0", 1, 1) ]

label start:
    "this text is shadowed"
    return
Play with the values to find the effect you want
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,943
Mmm how would i do this for the names of the characters that display's above the speech?

Code:
define j = Character("Jensen", color = "#F01711")
define np = Character("Nickola", color = "#0000FF")
define vp = Character("Victoria", color = "#83F75E")
define mb = Character("Brewster", color = "#A47929")
define lj = Character("Latisha", color = "#FFFF00")
define cb = Character("Cynthia", color = "#FF33FF")
define aj = Character("Abigail", color = "#FF33FF")
define fl = Character("Francine", color = "#FF33FF")
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,199
Mmm how would i do this for the names of the characters that display's above the speech?
It's defined by the "say_label" style, so you need something like this :
Code:
style say_label:
    outlines [ ( 0, "#0F0", 1, 1) ]
When you run the game, put the mouse over the right part, then press shift + I to open the "display inspector". It will show you all the styles used to display the said part. Keep in mind that every style can update one used above.

mouse.jpg di.jpg
 

Studio Errilhl

Member
Game Developer
Oct 16, 2017
315
237
You can also just define a specific character with the "who_outlines" attribute, if you don't want it to apply to all characters.
Code:
define unk_f = Character('Unknown female',who_outlines=[(absolute(1),"#999",absolute(0),absolute(0))])
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,199
You can also just define a specific character with the "who_outlines" attribute, if you don't want it to apply to all characters.
In fact it's even better than my answer. Generally the color used for the name is different according to the character, so using directly "who_outlines" let him color the shadow according to the name's color.
 
  • Like
Reactions: Studio Errilhl

Studio Errilhl

Member
Game Developer
Oct 16, 2017
315
237
In fact it's even better than my answer. Generally the color used for the name is different according to the character, so using directly "who_outlines" let him color the shadow according to the name's color.
That's a point. Personally, I use a different background for the namebox per character (the names themselves are the same color regardless), so I didn't think about that part :)
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,943
IT's working out nicely... Now i need to add an outline to the main speech text which i will be attempting now...

I also need to bring in my images with a fade in, fade out...
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,117
7,614
Just look at my sig. It's all in there.

And about the main dialogue or main speech (or simply 'text box') @anne O'nymous already mentioned above. It's the say_dialogue:

For example:

Code:
style say_dialogue:
    outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]
    color "#FFFFFF"
This gives you a black 2px outline shifted right and down for 1px, so it looks like a 1px outline with a 1 px shadow.
Color makes the text white.

If you are trying to make the box and name label background invisible in your own game, then just leave the "background image" for the "style window" and "background frame" for the "style namebox" undefined. I put them into my patch file only to override the possible existing background already defined in the game.
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,943
Thx for info....

I know how to manipulate the text box .png file thx... I would like to know where to place my intro images as you start up the game and would like to apply a fade in/fade out effect.

So when someone clicks on teh game exe and it starts up i would like to insert a warning adults only image and one that shows my Avatar name etc... Many devs have it in their games.

Just look at my sig. It's all in there.

And about the main dialogue or main speech (or simply 'text box') @anne O'nymous already mentioned above. It's the say_dialogue:

For example:

Code:
style say_dialogue:
    outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]
    color "#FFFFFF"
This gives you a black 2px outline shifted right and down for 1px, so it looks like a 1px outline with a 1 px shadow.
Color makes the text white.

If you are trying to make the box and name label background invisible in your own game, then just leave the "background image" for the "style window" and "background frame" for the "style namebox" undefined. I put them into my patch file only to override the possible existing background already defined in the game.
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,943
Thx... as for outlines, i have what I needed all working peachy...

Look into the "label splashscreen" (and put it before label start).

Also, to add outlines to the text, you can do "what_outlines=" on the character as well, again if you don't want it the same on all.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,117
7,614
Also, to add outlines to the text, you can do "what_outlines=" on the character as well, again if you don't want it the same on all.
Yes, but please do this only and only when you are actually trying to create different outlines for different characters, because using the what_outlines makes it impossible to create universal patches like mine that can change the global style for all of them at once. ;)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,199
Yes, but please do this only and only when you are actually trying to create different outlines for different characters, because using the what_outlines makes it impossible to create universal patches like mine that can change the global style for all of them at once. ;)
I agree. Once had to make a patch to invert background/foreground colors of the dial box. I had to track all the characters to do achieve it. Will never try again :D

This said, perhaps that the can be used to do the trick, but I'm not sure when it's called. If it's before the "say", then you can use it to test the "what_outlines" and other "what_", and so update them in the fly. Just double with an exclusion list to not do it again when a character is cleaned, and it should be universal.
It would probably also works if it's called during the prediction, since nothing is displayed yet at this time.
 

Johor1

Newbie
Nov 9, 2018
55
21
I'm trying in vain to get outlines on a text when a character says something when a specific circumstance occurs.

Something like:

character "Says something" # normal what_text
if exception_occurs:
-> character "Says something about the exception occurring" # what_text with outlines <-
 

guest1492

Member
Apr 28, 2018
350
288
Did you mean something like this?
Code:
init 0:
    style my_outlined_style is say_dialogue:
        outlines [ (absolute(1), "#000", absolute(0), absolute(0)) ]

label some_label:
    if some_flag:
        someone "Regular dialogue text"
    else:
        someone "Outlined dialogue text" (what_style = "my_outlined_style")
 
  • Like
Reactions: anne O'nymous

Johor1

Newbie
Nov 9, 2018
55
21
Did you mean something like this?
Code:
init 0:
    style my_outlined_style is say_dialogue:
        outlines [ (absolute(1), "#000", absolute(0), absolute(0)) ]

label some_label:
    if some_flag:
        someone "Regular dialogue text"
    else:
        someone "Outlined dialogue text" (what_style = "my_outlined_style")
Thanks for that. My mistake was using "is text" instead of "is say_dialogue". (And the official Renpy documentation was once again useless.)