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
User avatar
ArizaLuca
Regular
Posts: 118
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen
Tumblr: aa-games
Deviantart: ArizaLuca
itch: arizaluca
Contact:

Main Menu will not display Determinant Image

#1 Post by ArizaLuca » Thu Sep 13, 2018 9:07 pm

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?

User avatar
ArizaLuca
Regular
Posts: 118
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen
Tumblr: aa-games
Deviantart: ArizaLuca
itch: arizaluca
Contact:

Re: Main Menu will not display Determinant Image

#2 Post by ArizaLuca » Mon Sep 17, 2018 7:53 am

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

User avatar
Remix
Eileen-Class Veteran
Posts: 1022
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 » Mon Sep 17, 2018 12:45 pm

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
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Finish Catmull-Rom Spline pathing
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

Post Reply

Who is online

Users browsing this forum: majike