Showing text in dialogue box when hovering over choice button

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
User avatar
DerpyPidgeon
Newbie
Posts: 1
Joined: Sat Sep 15, 2018 8:51 am
Contact:

Showing text in dialogue box when hovering over choice button

#1 Post by DerpyPidgeon »

Hello!
So, I've been trying to put in my game a choice menu where you get some text telling you who's there and stuff. For now the way I've done is I've mixed the tooltip example from the documentation and parts of the choice screen. This works, but I was wondering if I could instead have some text spoken by a certain character (the one who is gonna be talking) appear in the textbox when hovering over a specific choice. This is what I've been using for now:

Code: Select all

screen tooltip_example():
    vbox:
        style_prefix "tooltip_example"
        if hall_intro_done == False:
            textbutton "The hall.":
                action Jump("hall_intro")
                tooltip "Here's some people."

        if lib_intro_done == False:
            textbutton "The library":
                action Jump("lib_intro")
                tooltip "Here's some other people."

        if cafe_intro_done == False:
            textbutton "The cafeteria.":
                action Jump("cafe_intro")
                tooltip "There are more people here."

        textbutton "I'm ok.":
            action Jump("introductions_over")
            tooltip "Skip introductions?"
        
        $ tooltip = GetTooltip()

        if tooltip:
            frame:
                xcenter 0.5
                text "[tooltip]" color "ff5ccd"
style tooltip_example_vbox is vbox
style tooltip_example_button is button
style tooltip_example_button_text is button_text

style tooltip_example_vbox:
    xalign 0.5
    ypos 0.2
    spacing gui.choice_spacing

style tooltip_example_button is default:
    properties gui.button_properties("choice_button")

style tooltip_example_button_text is default:
    properties gui.button_text_properties("choice_button")
Do I have to write something like

Code: Select all

use say
On a bit of a side note, the code for an action when hovered is this, right?

Code: Select all

hovered Jump("example")
Nevermind this, I tested it myself and it is.

Also I found this thread while looking for a solution, but there's no explanation on how it worked.
Thanks anyone and sorry for my English!

Post Reply

Who is online

Users browsing this forum: No registered users