Main Menu will not display Determinant 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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Main Menu will not display Determinant Image

#1 Post by ArizaLuca »

Code: Select all

if persistent.epilogue == True:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
    else:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover_full.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
I'm trying to show one version of a character when you hover over an imagebutton and the other version when you hover over it after achieving a certain ending; but it won't show the first version and only shows the one that you'd get after the ending. How to fix?

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Main Menu will not display Determinant Image

#2 Post by ArizaLuca »

Is this the right place to use an 'if-else' statement?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Main Menu will not display Determinant Image

#3 Post by Remix »

Try moving the if:else logic to the hovered, so just one button with:

Code: Select all

hovered [ If( persistent.epilogue,
                     Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover.png", my_tt_xpos=0, my_tt_ypos=0),
                     Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover_full.png", my_tt_xpos=0, my_tt_ypos=0) ) ]
You could also test with action Notify( "epilogue is {}".format( persistent.epilogue ) ) just to double check
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Google [Bot], Kia