• No results found

181Occasionally Used

In document Renpy Programming Manual (Page 181-187)

Variable: config.adv_nvl_transition = None

A transition that is used when showing NVL-mode text directly after ADV- mode text.

Variable: config.after_load_transition = None

A transition that is used after loading, when entering the loaded game.

Variable: config.auto_load = None

If not None, the name of a save file to automatically load when Ren'Py starts up. This is intended for developer use, rather than for end users. Setting this to "1" will automatically load the game in save slot 1. (new in 6.10.0)

Variable: config.automatic_images = None

If not None, this causes Ren'Py to automatically define images. When not set to None, this should be set to a list of separators. (For example, [ ' ', '_', '/' ].) Ren'Py will scan through the list of files on disk and in archives. When it finds a file ending with .png or .jpg, it will strip the extension, and break it apart at the separators, to create an image name. If the name consists of at least two components, and no image with that name already is defined, Ren'Py will define that image to refer to a filename.

For example, if your game directory contains:

 eileen_happy.png, Ren'Py will define the image "eileen happy".

 lucy/mad.png, Ren'Py will define the image "lucy mad".

 mary.png, Ren'Py will do nothing. (As the image does not have two components.)

(new in 6.10.0)

Variable: config.automatic_images_strip = []

A list of strings giving prefixes that are stripped out when defining automatic images. This can be used to remove directory names, when directories contain images. (new in 6.10.2)

182

Variable: config.debug = False

Enables some minor debugging functionality (mostly by turning some missing files into errors.) This should always be turned off in a release.

Variable: config.debug_image_cache = False

If True, Ren'Py will print the contents of the image cache to standard output (wherever that goes) whenever the contents of the image cache change.

Variable: config.debug_sound = False

Enables debugging of sound functionality. This disables the supression of errors when generating sound. However, if a sound card is missing or flawed, then such errors are normal, and enabling this may prevent Ren'Py from functioning normally. This should always be False in a released game.

Variable: config.default_afm_time = None

If not None, this sets the default auto-forward-mode timeout. If not None, then this is the time in seconds we should delay when showing 250 characters. 0 is special-cased to be infinite time, disabling auto-forward mode. (new in 6.11.0)

Variable: config.default_afm_enable = None

If not None, this should be a boolean that controls if auto-forward-mode is enabled by default. When it's False, auto-forwarding will not occur. Set this to False with caution, as the default Ren'Py UI does not provide a way of

changing it's setting. (But one can use Preference action in a screen to create such a UI.) (new in 6.11.0)

Variable: config.default_fullscreen = None

This sets the default value of the fullscreen preference. This should be True or False. If None, this is ignored, allowing other code to set the default value. (It's usually set to False in options.rpy.)

The file saves/persistent in the game directory must be deleted for this to take effect.

Variable: config.default_text_cps = None

If not None, this sets the default number of characters per second to show. 0 is special cased to mean an infinite number of characters per second. (It's usually set to 0 in options.rpy.)

183

The file saves/persistent in the game directory must be deleted for this to take effect.

Variable: config.empty_window = ...

This is called when _window is True, and no window has been shown on the screen. (That is, no call to renpy.shown_window has occured.) It's expected to show an empty window on the screen, and return without causing an

interaction.

The default implementation of this uses the narrator character to display a blank line without interacting.

Variable: config.end_game_transition = None

The transition that is used to display the main menu after the game ends normally, either by invoking return with no place to return to, or by calling

renpy.full_restart.

Variable: config.end_splash_transition = None

The transition that is used to display the main menu after the end of the splashscreen.

Variable: config.enter_sound = None

If not None, this is a sound file that is played when entering the game menu without clicking a button. (For example, when right-clicking during the game.)

Variable: config.enter_transition = None

If not None, this variable should give a transition that will be used when entering the game menu.

Variable: config.exit_sound = None

If not None, this is a sound file that is played when exiting the game menu without clicking a button. (For example, when right-clicking inside the game menu.)

Variable: config.exit_transition = None

If not None, this variable should give a transition that will be performed when exiting the game menu.

184

Variable: config.font_replacement_map = dict()

This is a map from (font, bold, italics) to (font, bold, italics), used to replace a font with one that's specialized as having bold and/or italics. For example, if you wanted to have everything using an italic version of "Vera.ttf" use

"VeraIt.ttf" instead, you could write config.font_replacement_map["Vera.ttf", False, True] = ("VeraIt.ttf", False, False). Please note that these mappings only apply to specific variants of a font. In this case, requests for a bold italic version of vera will get a bold italic version of vera, rather than a bold version of the italic vera.

Variable: config.framerate = 100

If not None, this is the upper limit on the number of frames Ren'Py will attempt to display per second.

Variable: config.game_main_transition = None

The transition that is used to display the main menu after leaving the game menu. This is used when the load and preferences screens are invoked from the main menu, and it's also used when the user picks "Main Menu" from the game menu.

Variable: config.game_menu = [ ... ]

This is used to customize the choices on the game menu. Please read Main and Game Menus for more details on the contents of this variable.

Variable: config.game_menu_music = None

If not None, a music file to play when at the game menu.

Variable: config.has_autosave = True

If true, the game will autosave. If false, no autosaving will occur.

Variable: config.hyperlink_callback = ...

A function that is called with the argument to a hyperlink when that hyperlink is clicked. Defaults to a function that inteprets the argument as a label, which is called in a new context when the hyperlink is clicked. The default function also dispatches arguments beginning with "http:" as urls, opening a web browser for them.

185

Variable: config.hyperlink_focus = None

If not None, a function that is called when a hyperlink gains or loses focus. When focus is gained, this function is called with a single argument, the argument of the hyperlink. When focus is lost, the function is called with None as its argument.

Variable: config.hyperlink_styler = ...

A function that is called to determine the style of hyperlinks. The function is called with a single argument, the argument of the hyperlink. It should return a style object, not a string. (new in 6.6.2)

Variable: config.image_cache_size = 8

This is used to set the size of the image cache, as a multiple of the screen size. This is mostly a suggestion, as if Ren'Py ever needs to display more than this amount of images at once, it will cache them all. But it will stop predictively loading images when the cache is filled beyond this, and it will try to drop images from the cache until it shrinks below this size. If this is too small, there will be more disk access as images are loaded and re-loaded. If this is too large, memory usage will be increased as images are kept in memory.

Variable: config.main_game_transition = None

The transition used when entering the game menu from the main menu, as is done when clicking "Load Game" or "Preferences".

Variable: config.main_menu = [ ( "Start Game", "start", "True" ), ("Continue Game", ... ), ("Preferences", ... ), ("Quit Game", ...) ]

This is used to give the main menu that is shown to the user when the game first starts. It is a list of tuples, where the first element of each tuple is the title of the menu button, and the second element is a label that we jump to when that button is selected. (This jump exits the context in which the start menu executes.) The second element may also be a function, in which case it is called when the item is selected, in the menu context. The third element in each tuple is an expression, which is evaluated each time the main menu is displayed. If the expression evaluates to false, the menu choice is disabled. For more information, see Main_and_Game_Menus

Variable: config.main_menu_music = None

186

Variable: config.menu_clear_layers = []

A list of layer names (as strings) that are cleared when entering the game menu. (new in 6.10.2)

Variable: config.menu_window_subtitle = ""

The _window_subtitle variable is set to this value when entering the main or game menus. (new in 6.7.1)

Variable: config.misssing_background = "black"

This is the background that is used when config.developer is True and an undefined image is used in a scene statement. This is an image name, not a displayable. The image must be defined. (new in 6.8.0)

Variable: config.mouse = None

This variable controls the use of user-defined mouse cursors. If None, the system mouse is used, which is usually a black-and-white mouse cursor. Otherwise, this should be a dictionary giving the mouse animations for

various mouse types. Keys used by the default library include "default", "say", "with", "menu", "prompt", "imagemap", "pause", "mainmenu", and

"gamemenu". The "default" key should always be present. The values in the dictionary should be list of frames making up the mouse cursor. Each frame is an (image, x-offset, y-offset) tuple. Image is a filename of an image, while x- and y- offset are the offsets of the hotspot within the image. The frames are played back at 20hz, and the animation loops after all frames have been shown. Please note that to show a frame more than once, it must be repeated in a frame list. That is implemented efficiently.

Variable: config.nvl_adv_transition = None

A transition that is used when showing ADV-mode text directly after NVL- mode text.

Variable: config.overlay_functions = [ ]

A list of functions. When called, each function is expected to return a list of displayables, which are added to the overlay list. See the section on overlays for more.

187

Variable: config.thumbnail_height = 75

The height of the thumbnails that are taken when the game is saved. These thumbnails are shown when the game is loaded. Please note that the thumbnail is shown at the size it was taken at, rather than the value of this setting when the thumbnail is shown to the user.

The default is set by the load_save layout, and so may differ from these values.

Variable: config.thumbnail_width = 100

The width of the thumbnails that are taken when the game is saved. These thumbnails are shown when the game is loaded. Please note that the thumbnail is shown at the size it was taken at, rather than the value of this setting when the thumbnail is shown to the user.

The default is set by the load_save layout, and so may differ from these values.

Variable: config.window_hide_transition = None

The transition used by the window hide statement when no transition has been explicitly specified.

Variable: config.window_overlay_functions = []

A list of overlay functions that are only called when the window is shown.

(new in 6.10.0)

Variable: config.window_show_transition = None

The transition used by the window show statement when no transition has been explicitly specified.

In document Renpy Programming Manual (Page 181-187)