Long story short, I've taken on the challenge to singlehandedly write, illustrate AND program my own visual novel. Thanks in no small part to the tutorials on the Ren'Py handbook tumblr and various bits of knowledge I found browsing these very threads, I've managed to put together a functional and decent-looking menu interface (mostly using imagebuttons).
The reason I'm calling out to the community now is that I've encountered a small, albeit annoying pebble during development. See, I have an extra menu where the player will find 1) a Gallery containing all unlocked CGs with character-specific sub-sections; 2) a Lore section containing complementary information on the game's story and universe; and 3) a Music section for all unlocked musical tracks.
The issue is found in the Gallery section. Toggling the different buttons to display their (for now, unexisting) contents works fine, but if I leave the extra menu to either go to the load/save or settings menu or return to the main menu, the five character buttons remain displayed.
Here is the code for the Extra menu I put together in screens.rpy (the different variables are declared in a separate file I named init.rpy in the /game folder):
Code: Select all
screen extra:
tag menu
add "GUI/extra/bg_extra.png"
# TOP BUTTONS
#__________________________________________G A L L E R Y
if show_gallery == False:
imagebutton:
idle "GUI/extra/gallery_idle.png"
hover "GUI/extra/gallery_hover.png"
xpos 522 ypos 50
action If(show_gallery, true=(Hide("gallery")), false=(Show("gallery"))),ToggleVariable("show_gallery",true_value=True, false_value=False),SetVariable("show_lore",False),SetVariable("show_music",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_gallery == True:
add "GUI/extra/cg_window.png" xpos 100 ypos 150
imagebutton:
idle "GUI/extra/gallery_selected_idle.png"
hover "GUI/extra/gallery_selected_hover.png"
xpos 522 ypos 50
action If(show_gallery, true=(Hide("gallery")), false=(Show("gallery"))),ToggleVariable("show_gallery",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________L O R E
if show_lore == False:
imagebutton:
idle "GUI/extra/lore_idle.png"
hover "GUI/extra/lore_hover.png"
xpos 800 ypos 50
action If(show_lore, true=(Hide("lore")), false=(Show("lore"))),ToggleVariable("show_lore",true_value=True, false_value=False),SetVariable("show_gallery",False),SetVariable("show_music",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_lore == True:
imagebutton:
idle "GUI/extra/lore_selected_idle.png"
hover "GUI/extra/lore_selected_hover.png"
xpos 800 ypos 50
action If(show_lore, true=(Hide("lore")), false=(Show("lore"))),ToggleVariable("show_lore",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________M U S I C
if show_music == False:
imagebutton:
idle "GUI/extra/music_idle.png"
hover "GUI/extra/music_hover.png"
xpos 1078 ypos 50
action If(show_music, true=(Hide("music")), false=(Show("music"))),ToggleVariable("show_music",true_value=True, false_value=False),SetVariable("show_gallery",False),SetVariable("show_lore",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_music == True:
imagebutton:
idle "GUI/extra/music_selected_idle.png"
hover "GUI/extra/music_selected_hover.png"
xpos 1078 ypos 50
action If(show_music, true=(Hide("music")), false=(Show("music"))),ToggleVariable("show_music",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
use navigation
#CHARACTER CG BUTTONS
screen gallery:
tag page
#__________________________________________C O M M O N
if show_common == False:
imagebutton:
idle "GUI/extra/cg_common_idle.png"
hover "GUI/extra/cg_common_hover.png"
xpos 100 ypos 150
action ToggleVariable("show_common",true_value=True, false_value=False),SetVariable("show_blaze",False),SetVariable("show_mizuha",False),SetVariable("show_yuuki",False),SetVariable("show_sinclair",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_common == True:
imagebutton:
idle "GUI/extra/cg_common_selected_idle.png"
hover "GUI/extra/cg_common_selected_hover.png"
xpos 100 ypos 150
action ToggleVariable("show_common",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________B L A Z E
if show_blaze == False:
imagebutton:
idle "GUI/extra/cg_blaze_idle.png"
hover "GUI/extra/cg_blaze_hover.png"
xpos 319 ypos 150
action ToggleVariable("show_blaze",true_value=True, false_value=False),SetVariable("show_common",False),SetVariable("show_mizuha",False),SetVariable("show_yuuki",False),SetVariable("show_sinclair",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_blaze == True:
imagebutton:
idle "GUI/extra/cg_blaze_selected_idle.png"
hover "GUI/extra/cg_blaze_selected_hover.png"
xpos 319 ypos 150
action ToggleVariable("show_blaze",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________M I Z U H A
if show_mizuha == False:
imagebutton:
idle "GUI/extra/cg_mizuha_idle.png"
hover "GUI/extra/cg_mizuha_hover.png"
xpos 538 ypos 150
action ToggleVariable("show_mizuha",true_value=True, false_value=False),SetVariable("show_common",False),SetVariable("show_blaze",False),SetVariable("show_yuuki",False),SetVariable("show_sinclair",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_mizuha == True:
imagebutton:
idle "GUI/extra/cg_mizuha_selected_idle.png"
hover "GUI/extra/cg_mizuha_selected_hover.png"
xpos 538 ypos 150
action ToggleVariable("show_mizuha",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________Y U U K I
if show_yuuki == False:
imagebutton:
idle "GUI/extra/cg_yuuki_idle.png"
hover "GUI/extra/cg_yuuki_hover.png"
xpos 757 ypos 150
action ToggleVariable("show_yuuki",true_value=True, false_value=False),SetVariable("show_common",False),SetVariable("show_blaze",False),SetVariable("show_mizuha",False),SetVariable("show_sinclair",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_yuuki == True:
imagebutton:
idle "GUI/extra/cg_yuuki_selected_idle.png"
hover "GUI/extra/cg_yuuki_selected_hover.png"
xpos 757 ypos 150
action ToggleVariable("show_yuuki",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
#__________________________________________S I N C L A I R
if show_sinclair == False:
imagebutton:
idle "GUI/extra/cg_sinclair_idle.png"
hover "GUI/extra/cg_sinclair_hover.png"
xpos 976 ypos 150
action ToggleVariable("show_sinclair",true_value=True, false_value=False),SetVariable("show_common",False),SetVariable("show_blaze",False),SetVariable("show_mizuha",False),SetVariable("show_yuuki",False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
if show_sinclair == True:
imagebutton:
idle "GUI/extra/cg_sinclair_selected_idle.png"
hover "GUI/extra/cg_sinclair_selected_hover.png"
xpos 976 ypos 150
action ToggleVariable("show_sinclair",true_value=True, false_value=False)
hover_sound "sounds/hover.ogg" activate_sound "sounds/click.ogg"
screen common:
tag page
screen blaze:
tag page
screen mizuha:
tag page
screen yuuki:
tag page
screen sinclair:
tag page
screen lore:
tag page
screen music:
tag page
Thanks in advance for any replies, and of course, you have my permission to bash me on the side of the head hard if the source of the problem is an obvious one.