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.
-
Exiscoming
- Regular
- Posts: 127
- Joined: Tue Apr 29, 2014 5:37 pm
-
Contact:
#1
Post
by Exiscoming » Thu Oct 31, 2019 8:00 am
So I'd like a tooltip to show up whenever you're hovering over an image button, and I do that like this
Code: Select all
vbox xpos 950 ypos 450:
imagebutton:
idle "button.png"
hover "button-hover.png" tooltip " "
action Jump("my_label")
$ tooltip = GetTooltip()
if tooltip:
image "tooltipGraphic.png" xpos 1000 ypos 500
This works just fine. However the problem is when I add a second button the same way. Hovering over 1 now shows both tooltips. Is there a way to give an id to the tooltip, so that only the one being hovered is shown?
-
Exiscoming
- Regular
- Posts: 127
- Joined: Tue Apr 29, 2014 5:37 pm
-
Contact:
#2
Post
by Exiscoming » Thu Oct 31, 2019 8:05 am
And of course I find the solution literally the moment I decide to make a thread about it.
Solution:
Code: Select all
vbox xpos 950 ypos 450:
imagebutton:
idle "button.png"
hover "button-hover.png" tooltip "1" # <-The ID should be added between the quotation marks. For example "1"
action Jump("my_label")
$ tooltip = GetTooltip()
if tooltip == "1": # <- Then in the if statement, make sure the tooltip equals "1" to have your item displayed.
image "tooltipGraphic.png" xpos 1000 ypos 500
Users browsing this forum: Bing [Bot], Google [Bot]