Ren'Py [SOLVED]HotSpot : Hovered without Action ?

GoldenD

Member
Sep 30, 2018
102
70
Can we have a Hovered event without any action.
I explain :

Python:
hotspot (85, 573, 169, 35) hovered myToolTip.Action("Description") # Doesn't work

hotspot (85, 573, 169, 35) action myFunction() hovered myToolTip.Action("Description")
# work Fine
And of course I just want give a description on hovered but no assign action !?
 

9thCrux

--Waifu maker--
Game Developer
Oct 22, 2017
844
3,221
Can we have a Hovered event without any action.
I explain :

Python:
hotspot (85, 573, 169, 35) hovered myToolTip.Action("Description") # Doesn't work

hotspot (85, 573, 169, 35) action myFunction() hovered myToolTip.Action("Description")
# work Fine
And of course I just want give a description on hovered but no assign action !?
Have you tried leaving the action blank?

Keep the action statement but don't specify any action, I was able to do that when I was building a point and click navigation system.

I was using imagebuttons though:

Python:
imagebutton auto "0.01a/Nav/hotel_%s.png" xpos 610 ypos 620 focus_mask True action
Nevermind, I tried again and is not working anymore...
 
Last edited:

GoldenD

Member
Sep 30, 2018
102
70
Have you tried leaving the action blank?

Keep the action statement but don't specify any action, I was able to do that when I was building a point and click navigation system.

I was using imagebuttons though:

Python:
imagebutton auto "0.01a/Nav/hotel_%s.png" xpos 610 ypos 620 focus_mask True action
Nevermind, I tried again and is not working anymore...

It's ok.
I do like this
Python:
hotspot (85, 573, 169, 35) action NullAction() hovered myToolTip.Action("Description")
.../...
hotspot (85, 573, 169, 35) action NullAction() hovered myToolTip.Action("Description")
.../...
 
Last edited:
  • Like
Reactions: 9thCrux

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,667
23,782
GoldenD read the documentation
you use the result of a function as hovered action.
but an action has to be either a function (and not the return value) without arguments, a screen action object or a list of it.
if you have to pass arguments, create your Action object

9thCrux to have a button do nothing but keep it responsive to events use the NullAction screen action
 
  • Like
Reactions: 9thCrux

GoldenD

Member
Sep 30, 2018
102
70
GoldenD read the documentation
you use the result of a function as hovered action.
but an action has to be either a function (and not the return value) without arguments, a screen action object or a list of it.
if you have to pass arguments, create your Action object

9thCrux to have a button do nothing but keep it responsive to events use the NullAction screen action
I've read this documentation and I think am sure the following code is correct and does what I want :
PHP:
hotspot (85, 573, 169, 35) action NullAction() tooltip "Description"
.../...
# or for textbutton
textbutton "{b}" + findWeaponName(Hero.weapons[0]) + "{/b}"   xpos 815    ypos 940:
            action NullAction()
            tooltip "Description"
.../...
For me it seems good in running code and correct with respect to the documentation.
 
Last edited:

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,667
23,782
the use of NullAction() isn't nitpicking.
try the code
Python:
screen actiontest():
    vbox:
        align (.5, .5)

        textbutton "TEST"
        textbutton "TEST" action
        textbutton "TEST" action None
        textbutton "TEST" action NullAction()
    
label start:
    call screen actiontest
    return
and see the differences.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,355
15,268
the use of NullAction() isn't nitpicking.
It's the opposite. The hovered property need a sensitive button to works. And the NullAction screen action is the only way to have a sensitive button that will have no effective effects.
 
  • Thinking Face
Reactions: 9thCrux