[Solved]Noob question abt text outlines

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
Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

[Solved]Noob question abt text outlines

#1 Post by Doeny »

So I've been searching for a while but couldn't find the answer, so I'll just ask here. How can I add outlines to a text like that:

Code: Select all

vbox:
	text "{color=#FFFFFF}This size 30 white text has some cool black outlines" size 30
Last edited by Doeny on Sat Nov 26, 2022 12:21 pm, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Noob question abt text outlines

#2 Post by Ocelot »

You can set an outlines style property together with size:
https://www.renpy.org/doc/html/style_pr ... y-outlines
outlines - list of tuple of (int, color, int, int)
This is a list of outlines that are drawn behind the text. Each tuple specifies an outline, and outlines are drawn from back to front.
The list contains (size, color, xoffset, yoffset) tuples. size is the amount the font is expanded by, in pixels. color is the color of the outline. xoffset and yoffset are the amount the outline is shifted by, in pixels.
The outline functionality can also be used to give drop-shadows to fonts, by specifying a size of 0 and non-zero offsets.
By default, size, xoffset and yoffset are scaled with the text. When given as the absolute type, they are not scaled. For example:

Code: Select all

style default:
    outlines [ (absolute(1), "#000", absolute(0), absolute(0)) ]
will always produce a 1 pixel-wide border.
Outlines only work with TrueType fonts. Outlines only work when applied to an entire Text displayable. They do not work when applied to a hyperlink, text tag, or other method that applies to only a portion of the text.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot], henne, Ocelot