having tooltips appear when hovering over button
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.
- Nuxill
- Veteran
- Posts: 464
- Joined: Sat Sep 25, 2010 4:50 pm
- Projects: No Friend
- Tumblr: nuxill
- itch: nuxill
- Contact:
having tooltips appear when hovering over button
I'm trying to make an effect similar to one on the main menu of Ristorante Amore, where a tooltip appears when the player hovers over a button. I'm having a bit of trouble wrapping my head around the code though. Is it possible to have this kind of tooltip show up if you use an image button or text button, or is it something only imagemaps are capable of?
- SundownKid
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: having tooltips appear when hovering over button
I have something like this that involves creating separate screens with the text, then setting the button action to show said screen when hovered, and hide when unhovered.
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: having tooltips appear when hovering over button
Buttons and hotspots both take hovered actions, so the code should still work. There's an actual tooltip function in Ren'Py, though, that might be easier to use than what I did.
- Nuxill
- Veteran
- Posts: 464
- Joined: Sat Sep 25, 2010 4:50 pm
- Projects: No Friend
- Tumblr: nuxill
- itch: nuxill
- Contact:
Re: having tooltips appear when hovering over button
I was thinking of doing something like this but a much more complicated version having to do with double the screens. I might try thisSundownkid wrote:I have something like this that involves creating separate screens with the text, then setting the button action to show said screen when hovered, and hide when unhovered.
I'm not able to get the hovered action to work with a textbutton... I think I'm doing something wrong. I'm guessingCamille wrote:Buttons and hotspots both take hovered actions, so the code should still work. There's an actual tooltip function in Ren'Py, though, that might be easier to use than what I did.
Code: Select all
textbutton "dog":
hovered Show("button1.png", transition=dissolve)
unhovered Hide("button1.png", transition=dissolve)
Also I didn't even know about the tooltip function!
Re: having tooltips appear when hovering over button
You can use the usual commands to position the text and buttons anywhere you'd like. For instance, going off the example...
That would let you move the frames containing the buttons and the text around seperately. You can of course set up your frames and windows and so on however you'd like.
The more complex actions it's referring to are when instead of using text tt.value you use some other command. The "tt.value" bit can be anything at all; the names of images, variables you want to update, etc. Then you can use any commands with it. Say you want a picture to flash up as a tooltip instead of some text, for instance.
Code: Select all
screen tooltip_test:
default tt = Tooltip("No button selected.")
frame:
xfill True
xalign 0.0
yalign 0.0
has vbox
textbutton "One.":
action Return(1)
hovered tt.Action("The loneliest number.")
textbutton "Two.":
action Return(2)
hovered tt.Action("Is what it takes.")
textbutton "Three.":
action Return(3)
hovered tt.Action("A crowd.")
frame:
vbox:
xalign 0.7
yalign 0.7
text tt.valueThe more complex actions it's referring to are when instead of using text tt.value you use some other command. The "tt.value" bit can be anything at all; the names of images, variables you want to update, etc. Then you can use any commands with it. Say you want a picture to flash up as a tooltip instead of some text, for instance.
- SundownKid
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: having tooltips appear when hovering over button
Is it possible to make these tooltips appear with transitions?
- Nuxill
- Veteran
- Posts: 464
- Joined: Sat Sep 25, 2010 4:50 pm
- Projects: No Friend
- Tumblr: nuxill
- itch: nuxill
- Contact:
Re: having tooltips appear when hovering over button
Thank you very much Showsni! I'm also curious if it's possible to have the tooltips appear with transitions.
Who is online
Users browsing this forum: Bing [Bot]
