Devlogs
Ren'Py Subtitles Textbox Source Code

UnderHoloA downloadable game for Windows, macOS, Linux, and Android

For Ren'py Devs
I liked the subtitles I made for UnderHolo, so I thought it would be interesting if I cleaned them up for other Ren'Py developers to use.
It's right here: https://cuteshadow.itch.io/subtitles-textbox-in-renpy
It's designed to be used in tandem with the normal textbox rather than replace it altogether.
Using it is very easy:
define e = Character("Eileen", screen="say_subtitle")
You can modify the text with the typical who_color, what_prefix, etc character properties.
How was it made:
The best way to learn how it was made is to download it yourself and check out the code :)
Here are some interesting design choices to think about:
- There's a rectangular background as you would see on many standard subtitles used in media. This makes the text stand out against the content by adding a physical layer of separation and provides a neutral background color we can contrast the text against.
- The first outline around the text is to further contrast against the content, especially since the background is slightly see-through.
- There's a second outline that's offset to create a drop shadow. This creates a 3D effect, but the main purpose is to make the text incredibly readable on any content.
- As cool as this looks, because the text is so large (40) this is probably more readable than many other implementations of textboxes.
- Since it's so minimal, it allows a lot of the visuals behind it to be seen clearly.
- The name will overflow upwards if it gets too long.
- The dialogue overflows downwards if it gets too long.
- This does mean if the text gets long enough it will overflow out of the screen but if your text gets that long then you should split your lines.
- Regarding Ren'Py specifically, this is functionally a copy/paste of the default say screen. By working on top of Ren'Py's existing systems, the subtitles are automatically integrated into key systems such as dialogue scripting and the history screen.