How do I add an outline to text? (SOLVED)

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
Cululush
Newbie
Posts: 5
Joined: Mon Dec 26, 2011 3:32 pm
Projects: A Tsundere Christmas Carol
Contact:

How do I add an outline to text? (SOLVED)

#1 Post by Cululush »

Hello.
I'm new to this program, and I was planning on making a short VN.
I have gone through most of the tutorial and I know pretty much all I need at the moment, except for one thing.
I have made a transparent background so that it would'nt block the image(I want it to be all across the screen), but now I can't see the text, due to having similar colour with the images.
I want to make a black outline for white text, so that it's visible. I've searched around, and I've seen some explanations, but I didn't quite understand what I'm supposed to do.
I want the outline to be on ALL the text. I don't mind not having it on buttons, though.
So, what is the easiest way to do this?

Thanks in advance.
Last edited by Cululush on Tue Dec 27, 2011 5:29 am, edited 1 time in total.

tuna_sushi
Veteran
Posts: 299
Joined: Thu Jul 07, 2011 9:33 am
Projects: BloomingBlossoms
Contact:

Re: How do I add an outline to text?

#2 Post by tuna_sushi »

If you want to outline the character's name, put

Code: Select all

who_outlines=[ (1, "#282") ]
if you want to outline the text as in.... the text (?) put

Code: Select all

what_outlines=[ (1, "#282") ]

Cululush
Newbie
Posts: 5
Joined: Mon Dec 26, 2011 3:32 pm
Projects: A Tsundere Christmas Carol
Contact:

Re: How do I add an outline to text?

#3 Post by Cululush »

Errrr, I'm sorry, I'm gonna need more than that...
I need to know where to put it and how it works.
Sorry, kinda new to this...
And I need both.

tuna_sushi
Veteran
Posts: 299
Joined: Thu Jul 07, 2011 9:33 am
Projects: BloomingBlossoms
Contact:

Re: How do I add an outline to text?

#4 Post by tuna_sushi »

Sorry for not being clear... :oops:

You will have to put it like this:

Code: Select all

# Declare characters used by this game.
define a = Character("Alice", color="#ffffff", who_outlines=[ (1, "##FF00FF") ], what_outlines=[ (1, "##FF00FF") ])
it will look like this (don't mind the pics ^_^" :oops:)
Attachments
123.png

Cululush
Newbie
Posts: 5
Joined: Mon Dec 26, 2011 3:32 pm
Projects: A Tsundere Christmas Carol
Contact:

Re: How do I add an outline to text?

#5 Post by Cululush »

Ugh...
Well, I did exactly as you said, I practically copied it and just changed the name.
The game works, but the moment it gets to a character with outline, it says the following:
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 40, in script
anon "Hi, /a/. Here's something I've put together to brighten your day (hopefully)."
File "template/game/screens.rpy", line 26, in python
text who id "who"
Exception: Color string must be 3, 4, 6, or 8 hex digits long.

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\execution.py", line 261, in run
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\ast.py", line 396, in execute
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\exports.py", line 696, in say
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\character.py", line 770, in __call__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\character.py", line 664, in do_display
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\character.py", line 450, in display_say
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\character.py", line 648, in do_show
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\character.py", line 263, in show_display_say
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\display\screen.py", line 562, in get_widget
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\display\screen.py", line 244, in update
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\screenlang.py", line 1166, in __call__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
File "template/game/screens.rpy", line 26, in <module>
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\ui.py", line 435, in __call__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\text\text.py", line 1017, in __init__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\display\core.py", line 127, in __init__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\style.py", line 810, in __init__
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\style.py", line 629, in build_style
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\style.py", line 514, in expand_properties
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\style.py", line 91, in expand_outlines
File "C:\Users\Asher\AppData\Local\Temp\Rar$EX76.42292\renpy-6.13.7\renpy\easy.py", line 65, in color
Exception: Color string must be 3, 4, 6, or 8 hex digits long.

Windows-post2008Server-6.1.7601-SP1
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0
Also, the game is mostly based on narration, so, is it possible to outline that too(Meaning - Do I have to make a character for that too?)?
What I really need is ALL the text outlined(In a solid black colour for everything). Is it possible to make the entire text outlined, without having to define every character with it?

P.S. I don't mind the pic, everyone and their style, and I don't think I'd personally be able to come up with anything better XD
P.S.S. sorry for the hassle>_> Really newbin' around.

DragoonHP
Miko-Class Veteran
Posts: 759
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: How do I add an outline to text?

#6 Post by DragoonHP »

Remove a # from "##FF00FF"

Cululush
Newbie
Posts: 5
Joined: Mon Dec 26, 2011 3:32 pm
Projects: A Tsundere Christmas Carol
Contact:

Re: How do I add an outline to text?

#7 Post by Cululush »

Hey, thanks! that worked.
Now just one last thing: How do I add an outline to text which isn't said by any character(as in narration)?
Is it possible?

User avatar
TsukiShima
Miko-Class Veteran
Posts: 778
Joined: Fri Aug 05, 2011 4:47 am
Projects: Heartful Memory
Location: Malaysia
Contact:

Re: How do I add an outline to text?

#8 Post by TsukiShima »

Cululush wrote:Hey, thanks! that worked.
Now just one last thing: How do I add an outline to text which isn't said by any character(as in narration)?
Is it possible?
It's like how tuna_sushi did, only if you want only the narrator to have it, you should declare the it as a character as well.

Code: Select all

# Declare characters used by this game.
define n = Character("", color="#ffffff", who_outlines=[ (1, "##FF00FF") ], what_outlines=[ (1, "##FF00FF") ])

Cululush
Newbie
Posts: 5
Joined: Mon Dec 26, 2011 3:32 pm
Projects: A Tsundere Christmas Carol
Contact:

Re: How do I add an outline to text?

#9 Post by Cululush »

Thanks a lot!!! It works.
Thank you, everyone. That's all I needed.

Kieron80
Newbie
Posts: 1
Joined: Wed Mar 06, 2019 1:02 pm
Contact:

Re: How do I add an outline to text? (SOLVED)

#10 Post by Kieron80 »

put this in your script, where you define your characters etc.

define gui.dialogue_text_outlines = [ (0, "#00000080", 2, 2) ]
define gui.charaters_text_outlines = [ (0, "#00000080", 2, 2) ]

bDunks
Newbie
Posts: 21
Joined: Tue Jan 08, 2019 3:07 pm
Contact:

Re: How do I add an outline to text? (SOLVED)

#11 Post by bDunks »

Kieron80 wrote: Wed Mar 06, 2019 1:05 pm put this in your script, where you define your characters etc.

define gui.dialogue_text_outlines = [ (0, "#00000080", 2, 2) ]
define gui.charaters_text_outlines = [ (0, "#00000080", 2, 2) ]
It's actually
define gui.name_text_outlines = [ (0, "#00000080", 2, 2) ]
Not characters. :)
Thanks for the info. Helped me out.

For anybody new, like me, here is some additional info.

Value 1 - Stroke/Outline
Value 2 - Color
Value 3 - X
Value 4 - Y

3 & 4 are for creating a drop shadow effect.
If I am wrong on this, feel free to correct me. :)

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

Re: How do I add an outline to text? (SOLVED)

#12 Post by Watercolorheart »

How do I add an outline to interface text?
I'm not even the same person anymore

gummii_exe
Newbie
Posts: 13
Joined: Fri Jun 10, 2022 11:42 am
Contact:

Re: How do I add an outline to text? (SOLVED)

#13 Post by gummii_exe »

Watercolorheart wrote: Mon Nov 16, 2020 5:23 pm How do I add an outline to interface text?
To do this, you would copy the same line of code as before, but change gui.name_text_outlines to gui.interface_text_outlines. For a lot of elements of Ren'Py, this same general rule of thumb applies.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1245
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How do I add an outline to text? (SOLVED)

#14 Post by m_from_space »

You just answered a question of 2020 in a thread that was started 2011. xD

Post Reply

Who is online

Users browsing this forum: No registered users