Ren'Py Inline Tooltips
Ever wanted your Visual Novel to mimic the lore clarifying tooltips you see in Obsidian games like Pentiment, Tyranny and Avowed? This piece of code will help you do just that!
If you want to see how it looks, give the web build a play.
Just drop the file into your renpy project and follow the instructions at the top of the file.
I was inspired to make this after seeing this amazing tool from gabmaag also submitted to MVNA, so please also check it out!
Check me out online on bluesky and other places.
Or check out my SWAK entry Fool Me Once:
Status | Released |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (7 total ratings) |
Author | Naoimh Murchan |
Made with | Ren'Py |
Tags | Ren'Py, tool |
Asset license | Creative Commons Attribution v4.0 International |
Download
Download
inline_tooltip.rpy 5.1 kB
Install instructions
Put the inline_tooltip.rpy file inside your game folder. Follow the instructions at the top of the document. If you're using Ren'Py's default UI, Steps 1 should be enough.
Development log
- Fixes!50 days ago
Comments
Log in with itch.io to leave a comment.
Hello! Thanks so much for this tool! ;A; <3 I can't express how grateful I am to have come across this.
I seem to have encountered an issue where the tooltip doesn't display at all! ;-;
Hiya, some questions:
- Have you edited the data array at line 4 in the file to include the words you want to have a tooltip? The text that is compared against is the array in element 2, they are case sensitive
- Are you using a custom ui? if your dialogue screen does not use the default renpy style 'say_dialogue' you will need to add the line `hyperlink_functions (inline_tooltip_styler, inline_tooltip_clicked, inline_tooltip_hovered)` to whatever style your dialogue screen text does use.
If this doesn't help I'd need some more details/to look at your code! (If you need further help, I'll be online later this weekend to take a look)
Hallo Naoimh! Thanks a ton for getting back to me! ;v;
I have edited line 4 and I think I have the four arguments (key, compare words, title, and description) filled out .
I am kind of using a custom UI as well, but I'm still using the built-in tags just styled differently--I have no idea if that affects anything! ;v;
OH--I think I figured it out! It looks like the lexicon script I implemented a while back was interfering with your tooltip code? ;v; so I removed both the lexicon.rpy and lexicon.rpyc files and it looks like we have liftoff!
Yay, I'm glad you could figure out the conflict in the end!
I can't thank you enough again! ; A; <3
Hello! We used this resource in our game jam project PainPal, really easy to understand and effective. Thanks for the great work!😊
This is an awesome alternative to the older "lexicon" style code by Remix. I was psyched to see how easily it handles alternate text strings. I'm using variables for character names and it not only reads the variables correctly, but lets me use full character names with spaces and color them individually. I spent several hours trying to wrangle the old code (much respect to Remix and the folks in the Discord who've upgraded it) to make any of that work, and this did it out of the box. Thank you so much for this!
Simple and clean. Inline tooltip is always in demand, and I think this is a good place to refer people to get started. (They can make it more robust later if they want).
no matter what i try i cannot seem to get this to work
[code]
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/inline_tooltip.rpy", line 7, in script
define inline_tooltip_list = [
File "game/inline_tooltip.rpy", line 8, in <module>
inline_tooltip_data("night", [_("Night"), "Night", "Night", _("night")], _("The Elves are a pointy eared people with a lot of rizz.")),
TypeError: __init__() missing 1 required positional argument: 'description'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/inline_tooltip.rpy", line 7, in script
define inline_tooltip_list = [
return eval(bytecode, globals, locals)
File "game/inline_tooltip.rpy", line 8, in <module>
inline_tooltip_data("night", [_("Night"), "Night", "Night", _("night")], _("The Elves are a pointy eared people with a lot of rizz.")),
TypeError: __init__() missing 1 required positional argument: 'description'
Windows-10-10.0.22631 AMD64
Ren'Py 8.3.4.24120703
Test Game 1.0
Sat Feb 15 23:06:49 2025
[/code]
The data requires 4 arguments, not 3!
The second last should be the title, and the last the description so it should probably look like:
This is great, amazing work!!! <3
Thank you so much, I wouldn't have even thought to make it if I hadn't seen your awesome tool submissions!
this is really useful & simple to understand! thank you for sharing.
(one thing that might come up is if you use keyboard navigation like arrow keys instead of mouse to hover, the tooltip may show in an odd place/cut off the screen since it is currently based only on mouse pos, but this can easily be edited on the user side by either making it display in a fixed position or ensuring the position is never below/above a certain amount)
Oh gosh, fantastic point! I'll look into trying to account for that next time I update this!