Expectations: hover mouse over textbutton, you see "Button#n hovered", move mouse from textbutton, text change to "Nothing hovered".
Reality: hover mouse over textbutton, you see "Button#n hovered", then right click or hit esc, you goes to save screen, then click return there, you back to game, no buttons actually hovered, but text is still "Button#n hovered".
Unhovered action didn't fired. How to fix it? Or how to get expected behavior in different way?
I have some ugly workaround in mind with DynamicDisplayable polling renpy.display.focus.get_focused every 0.1 second or so, but it's really ugly and cpu-not friendly.
Code: Select all
image DynaThing=DynamicDisplayable(GetDynaThing)
init python:
Thing=None
def GetDynaThing(st,at):
if Thing is None:
return Text("!!! Nothing hovered !!!"),None
else:
return Text("!!! Button#"+str(Thing)+" hovered !!!"),None
screen Test:
vbox:
add "DynaThing"
textbutton "Button#1":
action NullAction()
hovered SetVariable("Thing",1)
unhovered SetVariable("Thing",None)
textbutton "Button#2":
action NullAction()
hovered SetVariable("Thing",2)
unhovered SetVariable("Thing",None)
textbutton "Button#3":
action NullAction()
hovered SetVariable("Thing",3)
unhovered SetVariable("Thing",None)
label start:
show screen Test
"You've created a new Ren'Py game."
return
