Page 1 of 1

Adding an outline to "keywords" [Solved]

Posted: Sun Nov 14, 2021 2:28 pm
by MelloCloud
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

Re: Adding an outline to "keywords"

Posted: Sun Nov 14, 2021 3:18 pm
by rayminator
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."

Re: Adding an outline to "keywords"

Posted: Sun Nov 14, 2021 4:26 pm
by MelloCloud
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?

Re: Adding an outline to "keywords"

Posted: Sun Nov 14, 2021 4:28 pm
by drKlauz
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

Re: Adding an outline to "keywords"

Posted: Sun Nov 14, 2021 5:18 pm
by MelloCloud
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 :)