[SOLVED] Imagebutton that rollforward with an idle and an hover image

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
WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

[SOLVED] Imagebutton that rollforward with an idle and an hover image

#1 Post by WillandBran »

Hello !
I try to create a false button that rollforward with an hover and an idle image.
But, it doesn't work...
The button appear but the hover image don't remplace the idle image when it's hovered.
I try too to use the add function but it doesn't allow the hover and the idle features. T.T

Help, pleasou !!!
rollforward.png
rollforward2.png

Code: Select all

screen quick_menu():

    ## Ensure this appears on top of other screens.
    zorder 100
    if quick_menu:
        fixed:
            imagebutton idle "gui/textbox/avancer-idle.png":
                focus_mask True
                hover "gui/textbox/avancer-hover.png"
                action RollForward() xalign 1.0 yalign 1.0
            imagebutton idle "gui/textbox/retour-idle.png" : 
                focus_mask True
                hover "gui/textbox/retour-hover.png"
                insensitive "gui/textbox/nothing.png"
                action Rollback() xalign 0 yalign 1.0
Last edited by WillandBran on Sun Dec 22, 2019 12:15 pm, edited 1 time in total.

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

Re: Imagebutton that rollforward with an idle and an hover image

#2 Post by Alex »

That's ok - it happens 'cause game unable to rollforward at that place, so button behave like if it has 'None' as an action. Try to play some, then rolback and test if rollforward button will work.

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Imagebutton that rollforward with an idle and an hover image

#3 Post by WillandBran »

Ho !!!
Yes, it's work !
Thanks a lot !
I didn't understand what roll forward does...
I used a inapropriate function for what I wanted to do.
Are there a action that make the same thing that renpy do when you click whenever on the screen ? That just make the game advance ?
If no, is there a way for a image to have an hover and an idle image associated with ?

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

Re: Imagebutton that rollforward with an idle and an hover image

#4 Post by Alex »

Try to use Return() action for this button - while not in menu screen it should advance through the game

Code: Select all

            imagebutton idle "gui/textbox/avancer-idle.png":
                focus_mask True
                hover "gui/textbox/avancer-hover.png"
                action Return() xalign 1.0 yalign 1.0


https://www.renpy.org/doc/html/screen_a ... NullAction

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Imagebutton that rollforward with an idle and an hover image

#5 Post by WillandBran »

It's work !!!
I don't understand why it's working but it is !
Thanks a lot !

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]