Page 1 of 1

Tooltip on mouse cursor and custom UI?

Posted: Wed Mar 27, 2024 10:40 pm
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.

Re: Tooltip on mouse cursor and custom UI?

Posted: Thu Mar 28, 2024 12:25 am
by philat
Last I checked this still works - or at least should provide guidance towards getting where you want. viewtopic.php?t=47205

Re: Tooltip on mouse cursor and custom UI?

Posted: Thu Mar 28, 2024 2:13 am
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

Re: Tooltip on mouse cursor and custom UI?

Posted: Wed Apr 10, 2024 6:48 am
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.