I have been using the On-Screen Buttons code that is posted in the cookbook part of the Renpy site. I really love having the buttons there. Especially the auto button.
However, I find that it doesn't look very good to have the buttons on the screen during cut-scenes or during longer animations. I originally wanted to solve this by adding the buttons directly to the text vbox which renpy uses for the character's speach so that the buttons would only be visible when a character was speaking. Unfortunately, I can't find a way to do this without directly editing the character.rpy file and that seems like it's probubly not the best thing to do.
So, as a second best solution, I've been looking for a way to hide and show these on-screen buttons manually but I can't find which functions I would use to hide the buttons or even to modify them in any way once I have declared them.
Does anyone have any ideas? I'd appreciate anything that would point me in the right direction.
~Thanks
hiding on screen buttons (Solved)
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.
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.
- kuroi
- Regular
- Posts: 129
- Joined: Fri Jun 29, 2007 10:50 am
- Location: Albuquerque, New Mexico, USA
- Contact:
hiding on screen buttons (Solved)
Last edited by kuroi on Tue Apr 21, 2009 12:26 pm, edited 2 times in total.
President, Planner, and Programmer for Kuroi Games!
Re: hiding on screen buttons
Code: Select all
init python:
# Give us some space on the right side of the screen.
style.window.right_padding = 100
def toggle_skipping():
config.skipping = not config.skipping
show_button_game_menu = True
def button_game_menu():
if show_button_game_menu:
# to save typing
ccinc = renpy.curried_call_in_new_context
ui.vbox(xpos=0.99, ypos=0.98, xanchor='right', yanchor='bottom')
ui.textbutton("Skip", clicked=toggle_skipping, xminimum=80)
ui.textbutton("Save", clicked=ccinc("_game_menu_save"), xminimum=80)
ui.textbutton("Load", clicked=ccinc("_game_menu_load"), xminimum=80)
ui.textbutton("Prefs", clicked=ccinc("_game_menu_preferences"), xminimum=80)
ui.close()
config.overlay_functions.append(button_game_menu)
So if you wanted to disable the buttons, you could just write "$ show_button_game_menu = False", and if you wanted to re-enable them, you could write "$ show_button_game_menu = True".
- kuroi
- Regular
- Posts: 129
- Joined: Fri Jun 29, 2007 10:50 am
- Location: Albuquerque, New Mexico, USA
- Contact:
Re: hiding on screen buttons
Yay! Thank you so much!! That was the last thing I needed to figure out before I put out my game! you're the best~
President, Planner, and Programmer for Kuroi Games!
Who is online
Users browsing this forum: Ahrefs [Bot]