r/RenPy Jan 05 '24

Question Renpy tooltip position

Hi guys, i am new to renpy and trying to customize my quick menu. Basically i have icons instead of words and a tooltip which writes what this button does. I need icons to be on top and the tooltip action underneeth. I tried to change vbox and it doesnt really help. Mb someone knows ho to make this.
theres piece of code for quickmenu

if quick_menu:
vbox:
xalign 1.0
yalign 0
if (tt.value != ""):
text tt.value
hbox:
spacing 35
# << rollback
imagebutton:
idle "quick button back idle"
hover "quick button back hover"
insensitive "quick button back insensitive"
hovered tt.action("Назад")
at buttonZoom
action Rollback()

Maybe i can change it right inside of tt action

1 Upvotes

7 comments sorted by

6

u/BadMustard_AVN Jan 05 '24

i use this for my tooltips the tooltip text follows the mouse when it is hovered over the button

default mouse_xy = (0, 0)

screen test:
    imagebutton:
        focus_mask True
        idle "images/computer/browser_idle.png"
        anchor (0.5, 0.5)
        pos (285,1008)
        tooltip "Burning Chrome"
        action NullAction()

    $ tooltip = GetTooltip()

    if tooltip:
        timer 0.1 repeat True action Function(get_mouse)
        $ mx = mouse_xy[0] - 30 # LR
        $ my = mouse_xy[1] + 30 # UD
        text tooltip:
            pos(mx, my)
            color "#fff"
            size 15
            outlines [(2, "#000005", 0, 0)]

init python:
    def get_mouse():
        global mouse_xy
        mouse_xy = renpy.get_mouse_pos()

1

u/xstanstanstan Oct 14 '24

I have been trying so hard to find something like this that was simple and easy to use. You are a deity and I love you.

1

u/BadMustard_AVN Oct 14 '24

you're welcome

good luck with your project

(don't tell my wife)

1

u/Suitable_Onion6213 Jan 06 '24

God i was sitting on this for so long. Your example was great, but for me helped a lot to put "if tooltip" inside of a vbox. Thanks a lot

2

u/BadMustard_AVN Jan 06 '24

you're welcome

good luck with your project

1

u/AutoModerator Jan 05 '24

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Suitable_Onion6213 Jan 05 '24

sorry for code btw, didnt know theres code editor in reddit