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.
def button_game_menu():
if show_button_game_menu:
# to save typing
ccinc = renpy.curried_call_in_new_context
ui.hbox(xpos=0.99, ypos=0.98, xanchor='right', yanchor='bottom')
ui.textbutton("Skip", clicked=toggle_skipping)#skip
ui.textbutton("Save", clicked=ccinc("_game_menu_save"))#save
ui.textbutton("Load", clicked=ccinc("_game_menu_load"))#load
ui.textbutton("Prefs", clicked=ccinc("_game_menu_preferences"))#prefs
ui.textbutton("x", clicked= ui.callsinnewcontext("_hide_windows"))#hiding text window
ui.close()
config.overlay_functions.append(button_game_menu)
well, I think I know how to make save, load and prefs buttons according to this post: http://lemmasoft.renai.us/forums/viewto ... f=8&t=8756
but I don't know how to make the window-hiding button, and neither to making them desappearing at once, without hiding one for one.
please help me!!
Last edited by k i r a on Thu Jan 27, 2011 6:39 am, edited 1 time in total.
imagebutton:
# idle, hover, xpos, ypos, etc.
action ui.callsinnewcontext("_hide_windows")
Do you want the window-hiding button to hide the buttons, too? If so, I think the easiest way to do this is to put the buttons in the same screen as the text window. The text window is defined in the "say" screen, so if you define your own say screen and put your buttons in there, then your buttons will always show/hide along with the text window.
See backansi's post for the screen structure. Then you can define the properties for each imagebutton like in Sapphi's post.
However, if you have already done some customizations on your text window (for example, using show_side_image), then you might have to do more work on your say screen to port these customizations to screen language.
You can also append the buttons to the window_overlay_functions, instead of just the overlay functions, which will make them only show along with the text box. The cookbook function doesn't show this, but it really should.
Only problem with that is that they'll show up with menus, too. (I guess assuming you'll practice having a say window up for menus as well, which I do, so not a problem for me.) So editing the Say screen is the best choice here.