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

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

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

#1 Post 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 


Post Reply

Who is online

Users browsing this forum: Bing [Bot], downover, Google [Bot]