[Solved] Tooltips for Labels

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.
Post Reply
Message
Author
martingerdes
Regular
Posts: 26
Joined: Sun Oct 07, 2018 5:14 am
Contact:

[Solved] Tooltips for Labels

#1 Post by martingerdes »

According to https://www.renpy.org/doc/html/screen_a ... l#tooltips, any displayable can have a tooltip.

I would like to implement tooltips for stats in a grid (dse-stats.rpy from viewtopic.php?t=31571), so they should be associated with the labels, since there are no buttons.
However, nothing happens when I mouse over the labels. Probably because a label can not gain focus?

I tried to cheat and use it on a button without an action (I am sure I could style them to look like the labels do now), but without an action a button apparently can't gain focus either...

So is there a way to get a tooltip for something which is not clickable?
I guess my next best course of action would be a to make the labels into buttons with a "do nothing" dummy action. Just seems pretty unclean to me...

Is there a list of displayables which can have a tooltip (=gain focus)?

If there is any other documentation about this which I have not found, a link would be much appreciated!
Last edited by martingerdes on Thu Oct 11, 2018 3:40 pm, edited 1 time in total.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Tooltips for Labels

#2 Post by xavimat »

Not only labels, also mouseareas that have the "hovered" property, do not respond to tooltip.
Bars do respond if they can change some value (like in preferences), They don't if given a fixed value.

Probably doc should say, as you say, "available in all displayables that can gain focus" or "all displayables with hovered property" (but this is not always true).

In your case, you can use a textbutton. That "do nothing dummy action" you talk about actually exists: NullAction(). And it exists exactly for that reason, to make buttons(+textbuttons+hotspots+imagebuttons) "responsive to hover/unhover events, without actually doing anything."
https://www.renpy.org/doc/html/screen_a ... NullAction

In any case, I'll ask Pytom if maybe mouseareas and bars (or maybe all displayables) should be able to trigger tooltips.
Last edited by xavimat on Thu Oct 11, 2018 6:36 pm, edited 1 time in total.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

martingerdes
Regular
Posts: 26
Joined: Sun Oct 07, 2018 5:14 am
Contact:

Re: Tooltips for Labels

#3 Post by martingerdes »

Thank you for the information.
I know of no displayable "textbox", but a textbutton with NullAction() seems to work fine, and I can style it as needed.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Tooltips for Labels

#4 Post by xavimat »

martingerdes wrote: Thu Oct 11, 2018 3:39 pm Thank you for the information.
I know of no displayable "textbox", but a textbutton with NullAction() seems to work fine, and I can style it as needed.
Oh, sorry, my bad. I meant "textbutton". :oops:
I've corrected my previous post.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: IrisColt