[SOLVED] Is there a way to have hovered tooltip on a text?
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.
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.
[SOLVED] Is there a way to have hovered tooltip on a text?
Hey. I know tooltip can be used on imagebutton and textbutton, but what about just text?
I tried to be smart and use empty imagebutton on the spot where the text was placed in the screen, but whenever I hover over it moves the text for some reason.
I tried to be smart and use empty imagebutton on the spot where the text was placed in the screen, but whenever I hover over it moves the text for some reason.
Last edited by Ace94 on Fri Jul 10, 2020 6:49 am, edited 1 time in total.
Re: Is there a way to have hovered tooltip on a text?
That doesn't really help me. That's for dialogue and I need it in text. I need it for something like this:
So, when the player hovers over "total time played + the hours,minutes and seconds" I can show a tooltip saying that the timer doesn't count time spent in menus. I also have a few imagebutton tooltips in the same screen with styles and I want the text and tooltip to be with the same style.
Code: Select all
screen timer_screen():
add "gui/image.png"
modal True
#Total played time
$ minutes, seconds = divmod(int(persistent.runtime), 60)
$ hours, minutes = divmod(minutes, 60)
vbox:
xalign 0.588 yalign 0.338
text "Total time played: [hours]h:[minutes]m:[seconds]s " style "time_played" #<--- tooltip with style here
Re: Is there a way to have hovered tooltip on a text?
Hyperlinks work in text in screens.
- MaydohMaydoh
- Regular
- Posts: 165
- Joined: Mon Jul 09, 2018 5:49 am
- Projects: Fuwa Fuwa Panic
- Tumblr: maydohmaydoh
- Location: The Satellite of Love
- Contact:
Re: Is there a way to have hovered tooltip on a text?
Use a textbutton in place of the text
Re: Is there a way to have hovered tooltip on a text?
Okay, so I got this to work, but there's an issue. When I hover over the text it moves upwards and creates a duplicate underneath for some reason. Here's a pic showing what I mean:
Unhovered:
And when I hover with the mouse:
Here's the full code:
Code: Select all
textbutton "Total time played: [hours]h:[minutes]m:[seconds]s" action NullAction() text_style "inventory_played_time_button_text" anchor (0.5,0.5) tooltip "1"
$ tooltip = GetTooltip()
if tooltip == "1":
image "gui/inv_timer_tooltip.png" xpos 1000 ypos 500 anchor (0.5,0.5)
Re: Is there a way to have hovered tooltip on a text?
I found the problem! I was using vbox on the textbutton which made it appear twice for some reason. Removing that fixed the problem! Thanks, guys!
Who is online
Users browsing this forum: No registered users