Tooltip on mouse cursor and custom UI?

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
crowcinthus
Newbie
Posts: 1
Joined: Wed Mar 27, 2024 1:43 pm
Contact:

Tooltip on mouse cursor and custom UI?

#1 Post by crowcinthus »

Hi there, first forum post! I'm working on my first solo project and after getting the hang of tooltips, I've reached a conflict between my creative wants and my programming abilities. Is there any way to get tooltips to show when hovering over the material, but also follow the mouse cursor? Additionally, is there a way to have tooltip text appear on a custom background, not just with a frame?

I'm using the tooltip tutorial from https://www.renpy.org/doc/html/screen_a ... l#tooltips, which is as follows:

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]"
As it stands, the tooltip text appears below the vbox, which is not what I want.
we stay silly :3

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Tooltip on mouse cursor and custom UI?

#2 Post by philat »

Last I checked this still works - or at least should provide guidance towards getting where you want. viewtopic.php?t=47205

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Tooltip on mouse cursor and custom UI?

#3 Post by jeffster »

Since Ren'Py 7.5 / 8.0, there is a simple way to place tooltips next to target elements (e.g. those focused/hovered):
https://renpy.org/doc/html/changelog.ht ... rectangles
https://renpy.org/doc/html/screens.html#nearrect

BeverlyLane
Newbie
Posts: 3
Joined: Wed Apr 26, 2023 4:34 am
Contact:

Re: Tooltip on mouse cursor and custom UI?

#4 Post by BeverlyLane »

Thanks for sharing those links; I appreciate it. Since you also helped me with my problem, I also want to share one of my hidden gems with you all, which I used in my school journey and want to continue in college. They are a https://ukwritings.com/ writing service provider; they write essays, coursework, articles, and many more. I have been using them until now because they are affordable; that is why I have been using them for so long. If you are also a college student, you can try them once.

Post Reply

Who is online

Users browsing this forum: Li yuanlin, Semrush [Bot]