Caption Tool for Ren'Py
A downloadable tool
This is Caption Tool, a simple tool for adding image and sound captions to your Ren'Py game. (For an example of a game using this tool, take a look at last day of spring.) It was made in Ren'Py 7.2.2.491 and updated to support up to Ren'Py 7.4.6.1693. (It should work with newer versions of Ren'Py as well, but it has not been tested in them.)
Features:
- Image captions that work with Ren'Py's self-voicing option
- Sound captions for describing music and sound effects
- Dialogue on first run asking if users want to turn on captions
- Button to Ren'Py's built-in accessibility menu, which has options to change the font, font size and line spacing
- Guide to show how these functions work in-game
To use this tool, follow these steps:
- Copy the file named captiontool.rpy from the game folder into the game folder of your own game.
- Add the following textbutton a screen somewhere in your game, such as the Preferences screen in your game's screens.rpy file. (You can look at the screens.rpy file of this tool for an example.)
textbutton _("Accessibility") action ShowMenu("accessibility") - Edit captiontool.rpy to add your own sound/music and sound/music captions and make any other changes as necessary.
You can also play the guide by launching the tool through Ren'Py if you put the folder into your Ren'Py project directory. It gives examples of how image and sound captions can be used.
The code in this tool can be used in any way you like! If you use this tool, I would appreciate it if you credit Caption Tool or npckc (https://npckc.site or https://npckc.itch.io) in some way, but it isn't required.
~
Want to see more stuff like this? Sign up for my newsletter!
Join my Patreon for secret updates, a monthly digital postcard & early access to my games!
~
Updates:
- 2021/08/30 Added support for queueing audio files & Ren'Py 7.4 relative volume
- 2021/08/29 Removed {fast} tag from captiontool.rpy & added explanation for config.descriptive_text_character
- 2021/03/07 Fixed issue where captions would sometimes show the caption for the previous music file when the stop music command was used with fadeout
- 2020/12/09 Added support for custom sound/music channels
- 2019/09/17 Added more support for sound captions
- 2019/07/07 Updated to ren'py 7.3.2 which includes new descriptive text options
- 2019/05/22 Full release with updated music, font & choice UI
- 2019/05/21 Early access for patrons with placeholder music
Status | Released |
Category | Tool |
Rating | Rated 4.9 out of 5 stars (21 total ratings) |
Author | npckc |
Genre | Visual Novel |
Made with | Ren'Py |
Tags | accessibility, captions, Ren'Py |
Code license | MIT License |
Average session | A few minutes |
Languages | English |
Inputs | Keyboard, Mouse, Gamepad (any), Touchscreen |
Accessibility | Color-blind friendly, Subtitles, Interactive tutorial, One button, Blind friendly |
Links | Homepage, Twitter/X, Patreon |
Mentions | Add Accessibility to Ren'Py!, Version 2 Released!, Version 2.5 is Here!, two years since... a postmortem/q&a |
Download
Click download now to get access to the following files:
Development log
- Caption Tool for Ren'Py 1.02Jul 07, 2019
- Caption Tool for Ren'Py released!May 22, 2019
Comments
Log in with itch.io to leave a comment.
ty KC!
This is neat and straight-forward! Thanks for making it and making games more accessible :)
I just have a question... Is it possible to add this to button sounds somehow?
imagebutton idle "images/mag.png" action [Show("map_mag"), SetVariable("chaptermap", "mag")] focus_mask True activate_sound "sounds/magazine.ogg"
To confirm, you mean adding sound captions and not an image caption, correct? While it's not built in to Caption Tool, you can use sound captions in a button action with regular Ren'Py by using the function as an action in your button instead of using activate_sound.
Example:
imagebutton idle "images/mag.png" action [Show("map_mag"), SetVariable("chaptermap", "mag"), Function(play_sound, magazine)] focus_mask True
For this to work, you need to also have your magazine sound registered in your list of sounds.Ah yes, this is what I meant! I just tested it and it works fine :) Thank you.
Hi, I've come here to bring up an issue regarding the translation function for the captiontool. Whenever you change the language and change it back, the language captions remain the same...
For example, I selected the test language here. The captions change as intended, but when I change it back to English, they stay the same.
I'm on Ren'py 7.4.11.2266
i think that's an issue with renpy not reinitialising language settings upon load. (you'll find the same issue if you play around with languages and try to load a language with font A from a language with font B, where A and B don't support the same characters.)
it shouldn't be an issue if you start the game normally after changing the language & have the sound caption init as included in the sample project's start label. for safety you can add the init to renpy's after load label too.
Seems like it's a better idea to tie it to a persistent value and have separate sets of captions for each language, rather than let Renpy's translation function do the work, the captiontool in my game is very buggy regarding the translation function.
I'm taking a look into this myself and trying to find a way, but I'd like your word on it, thanks :D
i'm honestly not sure why yours is very buggy as i've published games with captions in multiple languages with no big issues, but please feel free to modify the code to fit your use!
Hello, I'm using your tool. I want to translate the text caption but I can't. I test it in your demo project but the text still not translated. Please help me, I don't understand with this...
When translating, you have to use Ren'Py's translation option to add a new language. The tool has an example language called "test" which you can look at to see how it works.
For image captions, all you have to do is include the translation in the translation files generated by Ren'Py.
For sound captions, see the example listed at the top of script.rpy.
I have seen the "test" language and try to change the language to other language. But in the game, its not change.
It is still "TEST Music: ..."
This is the translation script:
Do I have to change "soundtext = ("TEST Sound: ")" to "soundtext = _("TEST Sound: ")" so the language change?
As stated in my previous comment, for sound captions, see the example listed at the top of script.rpy. You change the text in the translate python section for each language.
Also, you should be generating new translation files for your language instead of using the TEST language. Please take a look here for more info about translating Ren'Py: https://www.renpy.org/doc/html/translation.html
Thank you for helping me.