Page 1 of 1

[Solved] How to force a button's hover state to true?

Posted: Tue Jul 20, 2021 8:19 pm
by henvu50
EDIT: Resolved in the latest version of Renpy. A new feature was added: renpy.set_focus('someScreen', 'someDisplayableID')

I need a way to force a button's hover state to true.
EDIT: I'm getting close

Code: Select all

screen screenWithButton():
      textbutton "test51":
         id "id_test51"
         action Show('testScreen')

init python:
     def someFunction():
        b = renpy.get_widget('screenWithButton', 'id_test51')
        b.focus = True              #didn't work
        b.hover = True              #didn't work
        b.hovered = True            #didn't work
        b.focused = True            #didn't work
        renpy.restart_interaction() #didn't help

        renpy.focus(b)      #let's try this after looking in the behavior.py"
        renpy.ui.focus(b)   #must be close