The bat_flap and bat_flaps was an animation I had on the main menu (bat_flaps being simply a duplicate of bat_flap) for showing when the imagebuttons were hovered. The issue seemed that clicking the load or preference menus would leave the animations shown as the engine never saw the buttons "unhovered" thus never removed them... I did find a way to make it work today by changing it to something like this...
Code: Select all
# The main menu buttons.
vbox xalign .50 yalign .70:
imagebutton auto "mm_buttons/fromthebeginning/button_%s.tga" focus_mask True action Start() hovered [ Show("bat_flap", my_xpos=250, my_ypos=293 ), Show("bat_flaps", my_xpos=550, my_ypos=293 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
imagebutton auto "mm_buttons/load/button_%s.tga" focus_mask True action [Hide("bat_flap"), Hide("bat_flaps"), ShowMenu('load')] hovered [ Show("bat_flap", my_xpos=250, my_ypos=353 ), Show("bat_flaps", my_xpos=550, my_ypos=353 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
imagebutton auto "mm_buttons/options/button_%s.tga" focus_mask True action [Hide("bat_flap"), Hide("bat_flaps"), ShowMenu('preferences')] hovered [ Show("bat_flap", my_xpos=250, my_ypos=408 ), Show("bat_flaps", my_xpos=550, my_ypos=408 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
vbox xalign .50 yalign .98:
imagebutton auto "mm_buttons/gameover/button_%s.tga" focus_mask True action Quit(confirm=False) hovered [ Show("bat_flap", my_xpos=250, my_ypos=525 ), Show("bat_flaps", my_xpos=550, my_ypos=525 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
Basically I just had to add the hide into the action command, which I had tried before but had put the hide command after the ShowMenu commands... which did not work I assume due to the engine processing the commands in order. Problem was solved when I moved the Hide commands to the front of the action command brackets.
As for my usage of TGAs... Normally I prefer PNG file formats but due to some restrictions, TGA is what I am using for now.
Edit: I seem to have missed adding the actual bat_flap portion in my original post... so I'll add this as reference...
Code: Select all
screen bat_flap:
add "batani" xpos my_xpos ypos my_ypos
screen bat_flaps:
add "batani" xpos my_xpos ypos my_ypos
##############################################################################
# Main Menu
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
# The main menu buttons.
vbox xalign .50 yalign .70:
imagebutton auto "mm_buttons/fromthebeginning/button_%s.tga" focus_mask True action Start() hovered [ Show("bat_flap", my_xpos=250, my_ypos=293 ), Show("bat_flaps", my_xpos=550, my_ypos=293 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
imagebutton auto "mm_buttons/load/button_%s.tga" focus_mask True action [Hide("bat_flap"), Hide("bat_flaps"), ShowMenu('load')] hovered [ Show("bat_flap", my_xpos=250, my_ypos=353 ), Show("bat_flaps", my_xpos=550, my_ypos=353 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
imagebutton auto "mm_buttons/options/button_%s.tga" focus_mask True action [Hide("bat_flap"), Hide("bat_flaps"), ShowMenu('preferences')] hovered [ Show("bat_flap", my_xpos=250, my_ypos=408 ), Show("bat_flaps", my_xpos=550, my_ypos=408 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
vbox xalign .50 yalign .98:
imagebutton auto "mm_buttons/gameover/button_%s.tga" focus_mask True action Quit(confirm=False) hovered [ Show("bat_flap", my_xpos=250, my_ypos=525 ), Show("bat_flaps", my_xpos=550, my_ypos=525 ) ] unhovered [ Hide("bat_flap"), Hide("bat_flaps") ]
init -2:
# Make all the main menu buttons be the same size.
style mm_button:
size_group "mm"
# Hover Animations
image batani:
"system/bat6.tga"
pause 0.05
"system/bat5.tga"
pause 0.05
"system/bat4.tga"
pause 0.05
"system/bat3.tga"
pause 0.05
"system/bat2.tga"
pause 0.05
"system/bat1.tga"
pause 0.05
"system/bat2.tga"
pause 0.05
"system/bat3.tga"
pause 0.05
"system/bat4.tga"
pause 0.05
"system/bat5.tga"
pause 0.05
"system/bat6.tga"
pause 0.05
"system/bat7.tga"
pause 0.05
repeat