Adding an outline to "keywords" [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
MelloCloud
Newbie
Posts: 8
Joined: Thu Dec 06, 2018 9:54 pm
Contact:

Adding an outline to "keywords" [Solved]

#1 Post by MelloCloud » Sun Nov 14, 2021 2:28 pm

I'm not sure how describe it other than a "keyword".
I learned from someone that i can have colored words show up when I type that word in brackets
for example

Code: Select all

define br = "{color=#000000}}Black Reaper{/color}"
and then whenever I type

Code: Select all

[br]
in the dialogue it will show up as "Black Reaper" in that color. Which is amazing and I love it.

My issue is... There's currently a scene with a black background, So when I type the keyword, its unreadable. Is there a way to add an outline to the word? So it's actually readable? I saw other posts for outlines, but wasn't sure of where to actually put in the code. Everywhere i tried to put it either ended in an error, everything after the brackets being in black text, or it displaying the keyword as normal with the rest of the code being in normal text.

This all stems from me not actually sure exactly how this code works. Does anyone have experience with this? :o
Last edited by MelloCloud on Sun Nov 14, 2021 5:22 pm, edited 1 time in total.

rayminator
Miko-Class Veteran
Posts: 754
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Adding an outline to "keywords"

#2 Post by rayminator » Sun Nov 14, 2021 3:18 pm

https://www.renpy.org/doc/html/text.htm ... tlinecolor
outlinecolor

The outline text tag changes all the outlines (including drop shadows) to the given color. The color should be in #rgb, #rgba, #rrggbb, or #rrggbbaa format.

Code: Select all

"Let's have a {outlinecolor=#00ff00}Green{/outlinecolor} outline."

MelloCloud
Newbie
Posts: 8
Joined: Thu Dec 06, 2018 9:54 pm
Contact:

Re: Adding an outline to "keywords"

#3 Post by MelloCloud » Sun Nov 14, 2021 4:26 pm

rayminator wrote:
Sun Nov 14, 2021 3:18 pm
https://www.renpy.org/doc/html/text.htm ... tlinecolor
outlinecolor

The outline text tag changes all the outlines (including drop shadows) to the given color. The color should be in #rgb, #rgba, #rrggbb, or #rrggbbaa format.

Code: Select all

"Let's have a {outlinecolor=#00ff00}Green{/outlinecolor} outline."
Hey, so I tried both adding

Code: Select all

{outlinecolor=#FFFFFF}[br]{/outlinecolor}
to the actual script that it's in. and then trying to change the define of [br] like this

Code: Select all

define br = "{color=#000000}{outlinecolor=#FFFFFF}Black Reaper{/outlinecolor}{/color}"
and both did nothing.
I also tried

Code: Select all

define br = "{outlinecolor=#FFFFFF}{color=#000000}Black Reaper{/color}{/outlinecolor}"
Which also does nothing. Am I doing something wrong?

drKlauz
Veteran
Posts: 237
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: Adding an outline to "keywords"

#4 Post by drKlauz » Sun Nov 14, 2021 4:28 pm

There is a trick. outlinecolor works only if text element have outline. Example:

Code: Select all

screen test():
  vbox:
    align (0.5,0.5)
    text "test {outlinecolor=#F0F}screen outlined{/} text (not working)"
    text "test {outlinecolor=#F0F}screen outlined{/} text (working)" outlines [(2,"#0000")]

label start:
  show screen test
  "test"
  return
What you might want to do:
- change style of your text/dialogs to have transparent/invisible outline

Code: Select all

outlines [(2,"#0000")]
- change color of this outline when needed by adding outlinecolor tag
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

MelloCloud
Newbie
Posts: 8
Joined: Thu Dec 06, 2018 9:54 pm
Contact:

Re: Adding an outline to "keywords"

#5 Post by MelloCloud » Sun Nov 14, 2021 5:18 pm

drKlauz wrote:
Sun Nov 14, 2021 4:28 pm
There is a trick. outlinecolor works only if text element have outline. Example:

Code: Select all

screen test():
  vbox:
    align (0.5,0.5)
    text "test {outlinecolor=#F0F}screen outlined{/} text (not working)"
    text "test {outlinecolor=#F0F}screen outlined{/} text (working)" outlines [(2,"#0000")]

label start:
  show screen test
  "test"
  return
What you might want to do:
- change style of your text/dialogs to have transparent/invisible outline

Code: Select all

outlines [(2,"#0000")]
- change color of this outline when needed by adding outlinecolor tag

Thanks dude! Everything got fixed by adding

Code: Select all

define gui.text_outlines = [(1,"#0000")]
To where I define stuff. Thanks so much for your suggestion. works like a charm :)

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_