How to play action when imagebutton is hovering? [ solved ]

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
bueraque
Newbie
Posts: 7
Joined: Fri Dec 21, 2018 5:12 am
Contact:

How to play action when imagebutton is hovering? [ solved ]

#1 Post by bueraque » Fri Dec 21, 2018 5:27 am

I need to make a imagebutton, who'll do action when she'll be hovered.
Last edited by bueraque on Tue Jan 08, 2019 12:28 pm, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How to play action when imagebutton is hovering?

#2 Post by Alex » Fri Dec 21, 2018 5:23 pm

Try something like

Code: Select all

screen my_scr():
    default txt = "???"
    text txt size 35 align(0.5,0.05) 
    imagebutton:
        idle "idle_img.png"
        hover "hover_img.png"
        action Jump("Start")
        hovered SetScreenVariable("x", "^-^")
        unhovered SetScreenVariable("x", "???")

label start:
    "..."
    show screen my_scr
    "... ..."
    "?"
https://www.renpy.org/doc/html/screens.html#imagebutton
https://www.renpy.org/doc/html/screen_actions.html

bueraque
Newbie
Posts: 7
Joined: Fri Dec 21, 2018 5:12 am
Contact:

Re: How to play action when imagebutton is hovering?

#3 Post by bueraque » Tue Jan 08, 2019 12:16 pm

Thanks.

Post Reply

Who is online

Users browsing this forum: Google [Bot]