Show descriptive text in caption box when hovering over a menu choice

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
unclepress
Newbie
Posts: 1
Joined: Mon Dec 03, 2018 12:04 am
Contact:

Show descriptive text in caption box when hovering over a menu choice

#1 Post by unclepress »

I want to alter the menu screen in Ren'Py so that when the mouse hovers over an option, the dialog box at the bottom is updated with descriptive text about that choice. Here's a quick mockup of how I would want it to look.
hover_desc_mockup.png
This is the menu function from the standard 'screens.rpy' file

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action

So I'm thinking each item needs a "description" field (in addition to caption and action) and then something like...

Code: Select all

on_hover i:
	caption = i.description
...happens in the for loop.

This seems feasible since the buttons can easily change color on hover, but I just don't know how to actually implement it. Help is super appreciated!!!

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: Show descriptive text in caption box when hovering over a menu choice

#2 Post by Nanahs »

Hi!! I found a tutorial of something similar to this. But it was for imagebutton, not menu.
I'm not really sure if this can help you someway, but give this video a look:
https://youtu.be/SDXG17W0cBA

Good luck.

Post Reply

Who is online

Users browsing this forum: MisterPinetree