On the script.rpy file my code looks like this:
Code: Select all
init python:
# This file adds a number of buttons to the lower-right hand corner of
# the screen. Three of these buttons jump to the game menu, which
# giving quick access to Load, Save, and Prefs. The fourth button
# toggles skipping, to make that more convenient.
# 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.textbutton ('Text History', clicked=ccinc("_game_menu_text_history"), xminimum=80)
ui.close()
config.window_overlay_functions.append(button_game_menu)
And I put the Cookbook text history code in a separate *.rpy file called "readback.rpy". Then I get errors like this:
Code: Select all
I'm sorry, but an uncaught exception occurred.
ScriptError: could not find label '_game_menu_text_history'.
While running game code:
- script at line 354 of G:\Game/game/script.rpy
-- Full Traceback ------------------------------------------------------------
File "G:\Downloads\renpy-6.12.0\renpy\bootstrap.py", line 279, in bootstrap
File "G:\Downloads\renpy-6.12.0\renpy\main.py", line 320, in main
File "G:\Downloads\renpy-6.12.0\renpy\main.py", line 93, in run
File "G:\Downloads\renpy-6.12.0\renpy\execution.py", line 259, in run
File "G:\Downloads\renpy-6.12.0\renpy\ast.py", line 367, in execute
File "G:\Downloads\renpy-6.12.0\renpy\exports.py", line 631, in say
File "G:\Downloads\renpy-6.12.0\renpy\store.py", line 352, in say
File "G:\Downloads\renpy-6.12.0\renpy\character.py", line 697, in __call__
File "G:\Downloads\renpy-6.12.0\renpy\character.py", line 651, in do_display
File "G:\Downloads\renpy-6.12.0\renpy\character.py", line 467, in display_say
File "G:\Downloads\renpy-6.12.0\renpy\ui.py", line 236, in interact
File "G:\Downloads\renpy-6.12.0\renpy\display\core.py", line 1627, in interact
File "G:\Downloads\renpy-6.12.0\renpy\display\core.py", line 2205, in interact_core
File "G:\Downloads\renpy-6.12.0\renpy\display\layout.py", line 672, in event
File "G:\Downloads\renpy-6.12.0\renpy\display\layout.py", line 672, in event
File "G:\Downloads\renpy-6.12.0\renpy\display\layout.py", line 672, in event
File "G:\Downloads\renpy-6.12.0\renpy\display\layout.py", line 672, in event
File "G:\Downloads\renpy-6.12.0\renpy\display\behavior.py", line 601, in event
File "G:\Downloads\renpy-6.12.0\renpy\display\behavior.py", line 187, in run
File "G:\Downloads\renpy-6.12.0\renpy\curry.py", line 38, in __call__
File "G:\Downloads\renpy-6.12.0\renpy\game.py", line 297, in call_in_new_context
File "G:\Downloads\renpy-6.12.0\renpy\execution.py", line 246, in run
File "G:\Downloads\renpy-6.12.0\renpy\script.py", line 480, in lookup
ScriptError: could not find label '_game_menu_text_history'.
While running game code:
- script at line 354 of G:\Game/game/script.rpy
Ren'Py Version: Ren'Py 6.12.0e
While we're at it, how do I use image buttons as the menu buttons and move it elsewhere? I don't particularly like it being in the bottom right corner and I want to customize their looks.