440 lines
27 KiB
HTML
440 lines
27 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>Interactive Director — Ren'Py Documentation</title>
|
|
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" />
|
|
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" />
|
|
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
|
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<script type="text/javascript" src="_static/language_data.js"></script>
|
|
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
|
|
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
|
|
<script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|
<link rel="search" title="Search" href="search.html" />
|
|
<link rel="next" title="NVL-Mode Tutorial" href="nvl_mode.html" />
|
|
<link rel="prev" title="Developer Tools" href="developer_tools.html" />
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
|
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
</head><body>
|
|
|
|
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="index.html">
|
|
Ren'Py Documentation</a>
|
|
<span class="navbar-text navbar-version pull-left"><b>7.5.3</b></span>
|
|
</div>
|
|
|
|
<div class="collapse navbar-collapse nav-collapse">
|
|
<ul class="nav navbar-nav">
|
|
|
|
<li><a href="https://www.renpy.org">Home Page</a></li>
|
|
<li><a href="https://www.renpy.org/doc/html/">Online Documentation</a></li>
|
|
|
|
|
|
<li class="dropdown globaltoc-container">
|
|
<a role="button"
|
|
id="dLabelGlobalToc"
|
|
data-toggle="dropdown"
|
|
data-target="#"
|
|
href="index.html">Site <b class="caret"></b></a>
|
|
<ul class="dropdown-menu globaltoc"
|
|
role="menu"
|
|
aria-labelledby="dLabelGlobalToc"><ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="gui.html">GUI Customization Guide</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="language_basics.html">Language Basics</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="label.html">Labels & Control Flow</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="dialogue.html">Dialogue and Narration</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="displaying_images.html">Displaying Images</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="menus.html">In-Game Menus</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Statements</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="conditional.html">Conditional Statements</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="audio.html">Audio</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="movie.html">Movie</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="voice.html">Voice</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="text.html">Text</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="translation.html">Translation</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="displayables.html">Displayables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="transforms.html">Transforms</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="transitions.html">Transitions</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="atl.html">Animation and Transformation Language</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="matrixcolor.html">Matrixcolor</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="layeredimage.html">Layered Images</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="3dstage.html">3D Stage</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="live2d.html">Live2D Cubism</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="style.html">Styles</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="style_properties.html">Style Properties</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="screens.html">Screens and Screen Language</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="screen_actions.html">Screen Actions, Values, and Functions</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="screen_special.html">Special Screen Names</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="screen_optimization.html">Screen Language Optimization</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration Variables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="preferences.html">Preference Variables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="store_variables.html">Store Variables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="mouse.html">Custom Mouse Cursors</a></li>
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="launcher.html">Launcher</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">Interactive Director</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="nvl_mode.html">NVL-Mode Tutorial</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="input.html">Text Input</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="side_image.html">Side Images</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="rooms.html">Image Gallery, Music Room, and Replay Actions</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="drag_drop.html">Drag and Drop</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="sprites.html">Sprites</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="keymap.html">Customizing the Keymap</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="achievement.html">Achievements</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="history.html">Dialogue History</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="multiple.html">Multiple Character Dialogue</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="splashscreen_presplash.html">Splashscreen and Presplash</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="statement_equivalents.html">Statement Equivalents</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="save_load_rollback.html">Saving, Loading, and Rollback</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="persistent.html">Persistent Data</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="trans_trans_python.html">Transforms and Transitions in Python</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="gui_advanced.html">Advanced GUI</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="screen_python.html">Screens and Python</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="modes.html">Modes</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="cdd.html">Creator-Defined Displayables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="cds.html">Creator-Defined Statements</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="custom_text_tags.html">Custom Text Tags</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="character_callbacks.html">Character Callbacks</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="file_python.html">File Access</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="color_class.html">Color Class</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="matrix.html">Matrix</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="model.html">Model-Based Rendering</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="other.html">Other Functions and Variables</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="build.html">Building Distributions</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="updater.html">Web Updater</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="android.html">Android</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="chromeos.html">Chrome OS/Chromebook</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="ios.html">iOS</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="iap.html">In-App Purchasing</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="gesture.html">Gestures</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="raspi.html">Raspberry Pi</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="problems.html">Dealing with Problems</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="environment_variables.html">Environment Variables</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="self_voicing.html">Self-Voicing</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="editor.html">Text Editor Integration</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="skins.html">Skins</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="translating_renpy.html">Translating Ren'Py</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog (Ren'Py 7.x-)</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="changelog6.html">Changelog (Ren'Py 6.11 - 6.99)</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="incompatible.html">Incompatible Changes</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="distributor.html">Distributor Notes</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="sponsors.html">Ren'Py Development Sponsors</a></li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="thequestion.html">Script of The Question</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="thequestion_nvl.html">NVL-mode script for The Question</a></li>
|
|
</ul>
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<form class="navbar-form navbar-right" action="search.html" method="get">
|
|
<div class="form-group">
|
|
<input type="text" name="q" class="form-control" placeholder="Search" />
|
|
</div>
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div id="sidebar" class="bs-sidenav" role="complementary"><ul>
|
|
<li><a class="reference internal" href="#">Interactive Director</a><ul>
|
|
<li><a class="reference internal" href="#using-the-director">Using the Director</a></li>
|
|
<li><a class="reference internal" href="#variables">Variables</a><ul>
|
|
<li><a class="reference internal" href="#scene-show-and-hide">Scene, Show, and Hide</a></li>
|
|
<li><a class="reference internal" href="#with">With</a></li>
|
|
<li><a class="reference internal" href="#play-queue-stop-and-voice">Play, Queue, Stop, and Voice</a></li>
|
|
<li><a class="reference internal" href="#access">Access</a></li>
|
|
<li><a class="reference internal" href="#line-spacing">Line Spacing</a></li>
|
|
<li><a class="reference internal" href="#viewport">Viewport</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference internal" href="#audio-filename-functions">Audio Filename Functions</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-9 content">
|
|
|
|
<div class="section" id="interactive-director">
|
|
<h1>Interactive Director<a class="headerlink" href="#interactive-director" title="Permalink to this headline"> link</a></h1>
|
|
<p>The Interactive Director is a tool that allows you to edit the script of
|
|
your game from inside Ren'Py itself, with a live preview of the results
|
|
of your editing. The director is not not meant as a complete
|
|
replacement for the use of a text editor, which is still required for
|
|
writing the dialogue, choices, and logic of the visual novel.</p>
|
|
<p>Rather, it's intended to help you direct your game's script, by adding:</p>
|
|
<ul class="simple">
|
|
<li>Image (say, show, and hide) statements.</li>
|
|
<li>Transition (with) statements.</li>
|
|
<li>Audio (play, queue, stop, and voice) statements.</li>
|
|
</ul>
|
|
<div class="section" id="using-the-director">
|
|
<h2>Using the Director<a class="headerlink" href="#using-the-director" title="Permalink to this headline"> link</a></h2>
|
|
<p>You can access the director after starting your game by pressing the D
|
|
(without Shift) key on your keyboard. If this is your first time in
|
|
a session running the director, Ren'Py will reload your game to ensure
|
|
it has the data required to edit it.</p>
|
|
<p>The first director screen you'll see shows a list of lines that ran before
|
|
the current line. Click outside the lines window to advance the script, or
|
|
rollback outside it to roll back. Click the + between a lines to add a line, or the ✎ before a
|
|
line to edit that line.</p>
|
|
<p>When editing a line, the statement type can be selected, along with
|
|
appropriate parameters. Choose "Add" to add the new line, "Change" to change
|
|
an existing line, "Cancel" to cancel editing, and "Remove" to remove an
|
|
existing line.</p>
|
|
<p>Click "Done" when finished editing.</p>
|
|
</div>
|
|
<div class="section" id="variables">
|
|
<h2>Variables<a class="headerlink" href="#variables" title="Permalink to this headline"> link</a></h2>
|
|
<p>There are a number of variables defined in the <code class="docutils literal notranslate"><span class="pre">director</span></code> namespace that control
|
|
how the interactive director functions. These can be set using the define statement,
|
|
or modified using Python.</p>
|
|
<div class="section" id="scene-show-and-hide">
|
|
<h3>Scene, Show, and Hide<a class="headerlink" href="#scene-show-and-hide" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.tag_blacklist">
|
|
<code class="descname">director.tag_blacklist</code> = { "black", "text", "vtext" }<a class="headerlink" href="#var-director.tag_blacklist" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>A blacklist of tags that will not be shown for the show, scene, or hide
|
|
statements.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.scene_tags">
|
|
<code class="descname">director.scene_tags</code> = { "bg" }<a class="headerlink" href="#var-director.scene_tags" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The set of tags that will be presented for the scene statement, and hidden
|
|
from the show statement.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.show_tags">
|
|
<code class="descname">director.show_tags</code> = set()<a class="headerlink" href="#var-director.show_tags" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>If not empty, only the tags present in this set will be presented for the
|
|
show statement.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.transforms">
|
|
<code class="descname">director.transforms</code> = [ "left", "center", "right" ]<a class="headerlink" href="#var-director.transforms" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>A list of transforms that will be presented as part of the editor.
|
|
In addition to these, any transform defined using the transform
|
|
statement outside of Ren'Py itself will be added to the list of
|
|
transforms, which is then sorted.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="with">
|
|
<h3>With<a class="headerlink" href="#with" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.transitions">
|
|
<code class="descname">director.transitions</code> = [ "dissolve", "pixellate" ]<a class="headerlink" href="#var-director.transitions" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>A list of transitions that are available to the with statement. Since
|
|
transitions can't be auto-detected, these must be added manually.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="play-queue-stop-and-voice">
|
|
<h3>Play, Queue, Stop, and Voice<a class="headerlink" href="#play-queue-stop-and-voice" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.audio_channels">
|
|
<code class="descname">director.audio_channels</code> = [ "music", "sound", "audio" ]<a class="headerlink" href="#var-director.audio_channels" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The name of the audio channels that can be used with the play, show
|
|
and stop statements.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.voice_channel">
|
|
<code class="descname">director.voice_channel</code> = "voice"<a class="headerlink" href="#var-director.voice_channel" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The name of the audio channel used by voice.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.audio_patterns">
|
|
<code class="descname">director.audio_patterns</code> = [ "*.opus", "*.ogg", "*.mp3" ]<a class="headerlink" href="#var-director.audio_patterns" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The default list of audio patterns that are used to match the files
|
|
available in an audio channel.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.audio_channel_patterns">
|
|
<code class="descname">director.audio_channel_patterns</code> = { }<a class="headerlink" href="#var-director.audio_channel_patterns" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>A map from a channel name to the list of audio patterns that are
|
|
available in that audio channel. For example, if this is set to
|
|
<code class="docutils literal notranslate"><span class="pre">{</span> <span class="pre">'sound'</span> <span class="pre">:</span> <span class="pre">[</span> <span class="pre">'sound/*.opus'</span> <span class="pre">],</span> <span class="pre">'music'</span> <span class="pre">:</span> <span class="pre">[</span> <span class="pre">'music/*.opus'</span> <span class="pre">]</span> <span class="pre">}</span></code> the
|
|
music and sound channels get their own lists of patterns.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="access">
|
|
<h3>Access<a class="headerlink" href="#access" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.button">
|
|
<code class="descname">director.button</code> = True<a class="headerlink" href="#var-director.button" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>If True, the director displays a screen with a button to access the
|
|
director window. If False, the game can provide it's own access, by
|
|
making available the director.Start action.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="line-spacing">
|
|
<h3>Line Spacing<a class="headerlink" href="#line-spacing" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.spacing">
|
|
<code class="descname">director.spacing</code> = 1<a class="headerlink" href="#var-director.spacing" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The spacing between a director (scene, show, hide, with, play, queue, and voice) line
|
|
and a non-director line, or vice versa. These spacings should be 0 or 1 lines, a higher spacing
|
|
may not work.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.director_spacing">
|
|
<code class="descname">director.director_spacing</code> = 0<a class="headerlink" href="#var-director.director_spacing" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The spacing between two consecutive director lines.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="var">
|
|
<dt id="var-director.other_spacing">
|
|
<code class="descname">director.other_spacing</code> = 0<a class="headerlink" href="#var-director.other_spacing" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The spacing between two consecutive non-director lines.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="viewport">
|
|
<h3>Viewport<a class="headerlink" href="#viewport" title="Permalink to this headline"> link</a></h3>
|
|
<dl class="var">
|
|
<dt id="var-director.viewport_height">
|
|
<code class="descname">director.viewport_height</code> = 280<a class="headerlink" href="#var-director.viewport_height" title="Permalink to this definition"> link</a></dt>
|
|
<dd><p>The maximum height of scrolling viewports used by the director.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="audio-filename-functions">
|
|
<h2>Audio Filename Functions<a class="headerlink" href="#audio-filename-functions" title="Permalink to this headline"> link</a></h2>
|
|
<p>There are a number of audio filename functions that can be used to convert
|
|
filenames on disk to filenames in Python source code. This can be used to
|
|
match Ren'Py functionality that maps filenames. For example, if one has:</p>
|
|
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">voice_filename_format</span> <span class="o">=</span> <span class="s2">"v/</span><span class="si">{filename}</span><span class="s2">.ogg"</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>one can define the functions:</p>
|
|
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">init</span> <span class="k">python</span> <span class="k">in</span> <span class="n">director</span><span class="p">:</span>
|
|
|
|
<span class="k">def</span> <span class="nf">audio_code_to_filename</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">code</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> This converts the name of an audio filename as seen in the code,</span>
|
|
<span class="sd"> to the filename as seen on disk.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">if</span> <span class="n">channel</span> <span class="o">==</span> <span class="s2">"voice"</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="s2">"v/"</span> <span class="o">+</span> <span class="n">code</span> <span class="o">+</span> <span class="s2">".ogg"</span>
|
|
|
|
<span class="k">return</span> <span class="n">code</span>
|
|
|
|
<span class="k">def</span> <span class="nf">audio_filename_to_code</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">fn</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> This converts the name of an audio filename on disk to the filename</span>
|
|
<span class="sd"> as seen in code.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">if</span> <span class="n">channel</span> <span class="o">==</span> <span class="s2">"voice"</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="n">fn</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"v/"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">".ogg"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
|
|
|
<span class="k">return</span> <span class="n">fn</span>
|
|
|
|
<span class="k">def</span> <span class="nf">audio_filename_to_display</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">fn</span><span class="p">):</span>
|
|
<span class="sd">"""</span>
|
|
<span class="sd"> This converts the audio filename as seen on disk so it can be</span>
|
|
<span class="sd"> presented to the creator.</span>
|
|
<span class="sd"> """</span>
|
|
|
|
<span class="k">if</span> <span class="n">channel</span> <span class="o">==</span> <span class="s2">"voice"</span><span class="p">:</span>
|
|
<span class="k">return</span> <span class="n">fn</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">"v/"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">".ogg"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
|
|
|
<span class="k">return</span> <span class="n">fn</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>to match it.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<footer class="footer">
|
|
<div class="container">
|
|
<p class="pull-right">
|
|
<a href="#">Back to top</a>
|
|
|
|
</p>
|
|
<p>
|
|
© Copyright 2012-2022, Tom Rothamel.<br/>
|
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.6.<br/>
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html> |