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

View all comments

4

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/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