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.
screen screen():
default st = Tooltip("sys/no.png")
...
for item in sorted_store:
...
$ spic = obj.pic
$ shpic = obj.hpic
$ stt = obj.tt # <-- This is the image that I want to show when the object is hovered
imagebutton:
idle spic
hover shpic
xpos xt ypos yt
action [SetVariable("obj", obj), obj_use]
hovered st.Action("[stt]")
add st.value xpos xt-100 ypos yt-100
This way, all the tooltip images of ALL the objects are displayed at the same time when I hover the object, even when I'm not hovering any other object but one.
Any idea on why this is happening and how can I do so that only the tooltip for the object that I'm hovering is displayed?
Last edited by Adrian_DVL on Fri Mar 27, 2020 5:38 pm, edited 1 time in total.
I must admit it really is much more simple, so thank you! Unfortunately, it does the same with a difference: now if I hover an object, the tooltip image for THAT object is displayed next to EVERY object over and over again.
What's the actual code you are using?
Did you placed imagebuttons inside a vbox?
How big are images used for imagebuttons - any chance they are overlap each other?
Try to set 'focus_mask' property for imagebuttons - https://www.renpy.org/doc/html/style_pr ... properties
Alex wrote: ↑Fri Mar 27, 2020 4:36 pm
Did you placed imagebuttons inside a vbox?
Nope.
Alex wrote: ↑Fri Mar 27, 2020 4:36 pm
How big are images used for imagebuttons - any chance they are overlap each other?
They're 80x80. They don't overlap each other at all. In fact, my problem is exactly the opposite: I can see them all, each one 100 pixels to the left and up from the object, but all of them at the same time.
for each button, but no matter what button you hovering they all set the same variable 'tooltip', so condition became true for all buttons. In code sample tooltip was showing once and not for each textbutton.
for each button, but no matter what button you hovering they all set the same variable 'tooltip', so condition became true for all buttons. In code sample tooltip was showing once and not for each textbutton.
And it finally worked! Thank you very much, you've helped me! Just for the record: you forgot to pass tt_x and tt_y parameters in your ex_tooltip screen, but for the rest it works as a charm. Thanks!