Tooltips being obsolete

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
80na_
Newbie
Posts: 5
Joined: Sat Jan 13, 2024 12:16 pm
Tumblr: athenamineblox
Contact:

Tooltips being obsolete

#1 Post by 80na_ »

I've been meaning ask this for a bit, but are the Tooltip functions not working?
I usually want this in my game to give description to what you're hovering over, but every time i try to copy the code, or do my research about how it works, it never does?
I don't get an error from the game itself, but the program i code in tells me that it's outdated or obsolete. And when i try it out, it just doesn't come up?

Is this a problem only i'm facing, and is there a solution to it?

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1011
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Tooltips being obsolete

#2 Post by m_from_space »

80na_ wrote: Sat Jan 27, 2024 9:30 am I've been meaning ask this for a bit, but are the Tooltip functions not working?
Tooltips are working fine. Maybe you might wanna show how you implemented the feature.
I don't get an error from the game itself, but the program i code in tells me that it's outdated or obsolete.
Hmm, what program? Maybe you're talking about the Tooltip class, which is obsolete.

In stable Renpy tooltips work like this:

Code: Select all

screen myscreen():
    $ tt = GetTooltip() or "(Tooltips are visible here.)"
    vbox:
        textbutton "Button 1" action NullAction() tooltip "Do nothing."
        textbutton "Button 2" action Hide() tooltip "Close this screen."
        text tt

User avatar
henne
Newbie
Posts: 18
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Tooltips being obsolete

#3 Post by henne »

m_from_space wrote: Sat Jan 27, 2024 9:49 am Hmm, what program? Maybe you're talking about the Tooltip class, which is obsolete.

Sounds like VSC (Visual Studio Code). If you have an old project with - let's say - LiveComposite (nowadays it is just called Composite) it will tell you that it is outdated.

80na_
Newbie
Posts: 5
Joined: Sat Jan 13, 2024 12:16 pm
Tumblr: athenamineblox
Contact:

Re: Tooltips being obsolete

#4 Post by 80na_ »

m_from_space wrote: Sat Jan 27, 2024 9:49 am Maybe you might wanna show how you implemented the feature.
Like, the code i've been using? I've been using something from the document.

Code: Select all

screen tooltip_example():
    vbox:
        textbutton "North":
            action Return("n")
            tooltip "To meet a polar bear."

        textbutton "South":
            action Return("s")
            tooltip "All the way to the tropics."

        textbutton "East":
            action Return("e")
            tooltip "So we can embrace the dawn."

        textbutton "West":
            action Return("w")
            tooltip "Where to go to see the best sunsets."
    
        $ tooltip = GetTooltip()
    
        if tooltip:
            text "[tooltip]"
If it helps, this is also the code i've been using for my screens.

Code: Select all

screen coat_menu():
    hbox:
        align(0.18,0.88)
        imagebutton:
            idle "coat"
            hover "coat_hover"            
            action Jump("coatfound") 

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1011
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Tooltips being obsolete

#5 Post by m_from_space »

80na_ wrote: Tue Feb 06, 2024 9:37 am Like, the code i've been using? I've been using something from the document.
Code looks fine to me. So what's not working? Tooltips not showing at all?

Make sure that the text object, that's actually showing the tooltip is not hidden by something else and has a font-color that's not matching the background (e.g. you're not going to see black text on black background). In the example the tooltip should appear below the "West" button.

Post Reply

Who is online

Users browsing this forum: Google [Bot]