renpy/doc/transitions.html
2023-01-18 23:13:55 +01:00

824 lines
55 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>Transitions &#8212; Ren&#39;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="Animation and Transformation Language" href="atl.html" />
<link rel="prev" title="Transforms" href="transforms.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&#39;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 &amp; 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 class="current">
<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 current"><a class="current reference internal" href="#">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>
<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"><a class="reference internal" href="director.html">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="#">Transitions</a><ul>
<li><a class="reference internal" href="#pre-defined-transitions">Pre-Defined Transitions</a></li>
<li><a class="reference internal" href="#transition-classes">Transition Classes</a></li>
<li><a class="reference internal" href="#transition-families">Transition Families</a></li>
<li><a class="reference internal" href="#dict-transitions">Dict Transitions</a></li>
<li><a class="reference internal" href="#see-also">See Also</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-9 content">
<div class="section" id="transitions">
<span id="id1"></span><h1>Transitions<a class="headerlink" href="#transitions" title="Permalink to this headline"> link</a></h1>
<p>Transitions can be used as part of the <a class="reference internal" href="displaying_images.html#with-statement"><span class="std std-ref">with statement</span></a>, as well as in other parts of Ren'Py, to apply
effects to changes in the scene. Ren'Py comes with a small number of
pre-defined transitions, which can be given directly to the with
statement. It also includes transition classes, which can be used to
create new transitions.</p>
<div class="section" id="pre-defined-transitions">
<h2>Pre-Defined Transitions<a class="headerlink" href="#pre-defined-transitions" title="Permalink to this headline"> link</a></h2>
<p>Pre-defined transitions can be given directly to the with
statement. For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">show</span> <span class="n">bg</span> <span class="n">washington</span>
<span class="k">with</span> <span class="n">dissolve</span>
</pre></div>
</div>
<dl class="var">
<dt id="var-fade">
<code class="descname">fade</code><a class="headerlink" href="#var-fade" title="Permalink to this definition"> link</a></dt>
<dd><p>Takes 0.5 seconds to fade to black, and then 0.5 seconds to
fade to the new screen. An instance of the <a class="reference internal" href="#Fade" title="Fade"><code class="xref py py-func docutils literal notranslate"><span class="pre">Fade()</span></code></a> transition
class.</p>
</dd></dl>
<dl class="var">
<dt id="var-dissolve">
<code class="descname">dissolve</code><a class="headerlink" href="#var-dissolve" title="Permalink to this definition"> link</a></dt>
<dd><p>Takes 0.5 seconds to dissolve from the old to the new screen. An
instance of the <a class="reference internal" href="#Dissolve" title="Dissolve"><code class="xref py py-func docutils literal notranslate"><span class="pre">Dissolve()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-pixellate">
<code class="descname">pixellate</code><a class="headerlink" href="#var-pixellate" title="Permalink to this definition"> link</a></dt>
<dd><p>Pixellates the old scene for .5 seconds, and the new scene for
another .5 seconds. An instance of the <a class="reference internal" href="#Pixellate" title="Pixellate"><code class="xref py py-func docutils literal notranslate"><span class="pre">Pixellate()</span></code></a>
transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-move">
<code class="descname">move</code><a class="headerlink" href="#var-move" title="Permalink to this definition"> link</a></dt>
<dd><p>Takes 0.5 seconds to the move images that have changed location to
their new locations. An instance of the <a class="reference internal" href="#MoveTransition" title="MoveTransition"><code class="xref py py-func docutils literal notranslate"><span class="pre">MoveTransition()</span></code></a>
transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-moveinright">
<code class="descname">moveinright</code><a class="headerlink" href="#var-moveinright" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>moveinleft, moveintop, moveinbottom</strong></p>
<p>These move entering images onto the screen from the appropriate
side, taking 0.5 seconds to do so.</p>
</dd></dl>
<dl class="var">
<dt id="var-moveoutright">
<code class="descname">moveoutright</code><a class="headerlink" href="#var-moveoutright" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>moveoutleft, moveouttop, moveoutbottom</strong></p>
<p>These move leaving images off the screen via the appropriate side,
taking 0.5 seconds to do so.</p>
</dd></dl>
<dl class="var">
<dt id="var-ease">
<code class="descname">ease</code><a class="headerlink" href="#var-ease" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>easeinright, easeinleft, easeintop, easeinbottom, easeoutright, easeoutleft, easeouttop, easeoutbottom</strong></p>
<p>These are similar to the move- family of transitions, except that
they use a cosine-based curve to slow down the start and end of
the transition.</p>
</dd></dl>
<dl class="var">
<dt id="var-zoomin">
<code class="descname">zoomin</code><a class="headerlink" href="#var-zoomin" title="Permalink to this definition"> link</a></dt>
<dd><p>This zooms in entering images, taking 0.5 seconds to do so.</p>
</dd></dl>
<dl class="var">
<dt id="var-zoomout">
<code class="descname">zoomout</code><a class="headerlink" href="#var-zoomout" title="Permalink to this definition"> link</a></dt>
<dd><p>This zooms out leaving images, taking 0.5 seconds to do so.</p>
</dd></dl>
<dl class="var">
<dt id="var-zoominout">
<code class="descname">zoominout</code><a class="headerlink" href="#var-zoominout" title="Permalink to this definition"> link</a></dt>
<dd><p>This zooms in entering images and zooms out leaving images, taking 0.5 seconds to do so.</p>
</dd></dl>
<dl class="var">
<dt id="var-vpunch">
<code class="descname">vpunch</code><a class="headerlink" href="#var-vpunch" title="Permalink to this definition"> link</a></dt>
<dd><p>When invoked, this transition shakes the screen vertically for a
quarter second.</p>
</dd></dl>
<dl class="var">
<dt id="var-hpunch">
<code class="descname">hpunch</code><a class="headerlink" href="#var-hpunch" title="Permalink to this definition"> link</a></dt>
<dd><p>When invoked, this transition shakes the screen horizontally for a
quarter second.</p>
</dd></dl>
<dl class="var">
<dt id="var-blinds">
<code class="descname">blinds</code><a class="headerlink" href="#var-blinds" title="Permalink to this definition"> link</a></dt>
<dd><p>Transitions the screen in a vertical blinds effect lasting 1
second. An instance of the <a class="reference internal" href="#ImageDissolve" title="ImageDissolve"><code class="xref py py-func docutils literal notranslate"><span class="pre">ImageDissolve()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-squares">
<code class="descname">squares</code><a class="headerlink" href="#var-squares" title="Permalink to this definition"> link</a></dt>
<dd><p>Transitions the screen in a squares effect lasting 1 second.</p>
</dd></dl>
<dl class="var">
<dt id="var-wipeleft">
<code class="descname">wipeleft</code><a class="headerlink" href="#var-wipeleft" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>wiperight, wipeup, wipedown</strong></p>
<p>Wipes the scene in the given direction. Instances of the
<a class="reference internal" href="#CropMove" title="CropMove"><code class="xref py py-func docutils literal notranslate"><span class="pre">CropMove()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-slideleft">
<code class="descname">slideleft</code><a class="headerlink" href="#var-slideleft" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>slideright, slideup, slidedown</strong></p>
<p>Slides the new scene in the given direction. Instances of the
<a class="reference internal" href="#CropMove" title="CropMove"><code class="xref py py-func docutils literal notranslate"><span class="pre">CropMove()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-slideawayleft">
<code class="descname">slideawayleft</code><a class="headerlink" href="#var-slideawayleft" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>slideawayright, slideawayup, slideawaydown</strong></p>
<p>Slides the old scene in the given direction. Instances of the
<a class="reference internal" href="#CropMove" title="CropMove"><code class="xref py py-func docutils literal notranslate"><span class="pre">CropMove()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-pushright">
<code class="descname">pushright</code><a class="headerlink" href="#var-pushright" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>pushleft, pushup, pushdown</strong></p>
<p>These use the new scene to slide the old scene out the named
side. Instances of the <a class="reference internal" href="#PushMove" title="PushMove"><code class="xref py py-func docutils literal notranslate"><span class="pre">PushMove()</span></code></a> transition class.</p>
</dd></dl>
<dl class="var">
<dt id="var-irisin">
<code class="descname">irisin</code><a class="headerlink" href="#var-irisin" title="Permalink to this definition"> link</a></dt>
<dd><p>Also: <strong>irisout</strong></p>
<p>Use a rectangular iris to display the new screen, or hide the old
screen. Instances of the <a class="reference internal" href="#CropMove" title="CropMove"><code class="xref py py-func docutils literal notranslate"><span class="pre">CropMove()</span></code></a> transition class.</p>
</dd></dl>
</div>
<div class="section" id="transition-classes">
<h2>Transition Classes<a class="headerlink" href="#transition-classes" title="Permalink to this headline"> link</a></h2>
<p>Transition classes are functions that can be called to create new
transitions. These functions are parameterized, allowing entire
families of transitions to be created.</p>
<p>Calling transition classes can be done as part of the with
statement. For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># A very long dissolve.</span>
<span class="k">with</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">10.0</span><span class="p">)</span>
</pre></div>
</div>
<p>If we find ourselves calling the same transition class repeatedly, we
can use the <a class="reference internal" href="python.html#define-statement"><span class="std std-ref">define statement</span></a> to assign the
transition to a variable:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">annoytheuser</span> <span class="o">=</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">1.0</span><span class="p">)</span>
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="k">show</span> <span class="n">bg</span> <span class="n">washington</span>
<span class="k">with</span> <span class="n">annoytheuser</span>
</pre></div>
</div>
<p>The time_warp argument taken by many transition classes can be given
builtin warpers found in the <code class="docutils literal notranslate"><span class="pre">_warper</span></code> module,
see <a class="reference internal" href="atl.html#warpers"><span class="std std-ref">warpers</span></a>.</p>
<dl class="function">
<dt id="AlphaDissolve">
<code class="descname">AlphaDissolve</code><span class="sig-paren">(</span><em>control</em>, <em>delay=0.0</em>, <em>alpha=False</em>, <em>reverse=False</em>, <em>**properties</em><span class="sig-paren">)</span><a class="headerlink" href="#AlphaDissolve" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that uses a control displayable (almost always some
sort of animated transform) to transition from one screen to another. The
transform is evaluated. The new screen is used where the transform is
opaque, and the old image is used when it is transparent.</p>
<dl class="docutils">
<dt><cite>control</cite></dt>
<dd>The control transform.</dd>
<dt><cite>delay</cite></dt>
<dd>The time the transition takes, before ending.</dd>
<dt><cite>alpha</cite></dt>
<dd>Ignored.</dd>
<dt><cite>reverse</cite></dt>
<dd>If true, the alpha channel is reversed. Opaque areas are taken
from the old image, while transparent areas are taken from the
new image.</dd>
</dl>
<p>When the dissolve will be scaled to less than half its natural size, the
<a class="reference internal" href="style_properties.html#style-property-mipmap"><code class="xref std std-propref docutils literal notranslate"><span class="pre">mipmap</span></code></a> style property can be set to True. This will cause mipmaps
to be generated, which will make the dissolve consume more GPU resources,
but will reduce artifacts.</p>
</dd></dl>
<dl class="function">
<dt id="ComposeTransition">
<code class="descname">ComposeTransition</code><span class="sig-paren">(</span><em>trans</em>, <em>before</em>, <em>after</em><span class="sig-paren">)</span><a class="headerlink" href="#ComposeTransition" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that composes up to three transitions. If not None,
the <cite>before</cite> and <cite>after</cite> transitions are applied to the old and new
scenes, respectively. These updated old and new scenes are then supplied
to the <cite>trans</cite> transition.</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Move the images in and out while dissolving. (This is a fairly expensive transition.)</span>
<span class="k">define</span> <span class="n">moveinoutdissolve</span> <span class="o">=</span> <span class="n">ComposeTransition</span><span class="p">(</span><span class="n">dissolve</span><span class="p">,</span> <span class="n">before</span><span class="o">=</span><span class="n">moveoutleft</span><span class="p">,</span> <span class="n">after</span><span class="o">=</span><span class="n">moveinright</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="CropMove">
<code class="descname">CropMove</code><span class="sig-paren">(</span><em>time</em>, <em>mode=&quot;slideright&quot;</em>, <em>startcrop=(0.0</em>, <em>0.0</em>, <em>0.0</em>, <em>1.0)</em>, <em>startpos=(0.0</em>, <em>0.0)</em>, <em>endcrop=(0.0</em>, <em>0.0</em>, <em>1.0</em>, <em>1.0)</em>, <em>endpos=(0.0</em>, <em>0.0)</em>, <em>topnew=True</em><span class="sig-paren">)</span><a class="headerlink" href="#CropMove" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that works by cropping a scene and positioning it on the
screen. This can be used to implement a variety of effects, all of which
involve changing rectangular slices of scenes.</p>
<dl class="docutils">
<dt><cite>time</cite></dt>
<dd>The time the transition takes.</dd>
<dt><cite>mode</cite></dt>
<dd><p class="first">The name of the mode of the transition. There are three groups
of modes: wipes, slides, and other. This can also be &quot;custom&quot;,
to allow a custom mode to be defined.</p>
<p>In a wipe, the image stays fixed, and more of it is revealed as
the transition progresses. For example, in &quot;wiperight&quot;, a wipe from left to right, first the left edge of the image is
revealed at the left edge of the screen, then the center of the image,
and finally the right side of the image at the right of the screen.
Other supported wipes are &quot;wipeleft&quot;, &quot;wipedown&quot;, and &quot;wipeup&quot;.</p>
<p>In a slide, the image moves. So in a &quot;slideright&quot;, the right edge of the
image starts at the left edge of the screen, and moves to the right
as the transition progresses. Other slides are &quot;slideleft&quot;, &quot;slidedown&quot;,
and &quot;slideup&quot;.</p>
<p>There are also slideaways, in which the old image moves on top of
the new image. Slideaways include &quot;slideawayright&quot;, &quot;slideawayleft&quot;,
&quot;slideawayup&quot;, and &quot;slideawaydown&quot;.</p>
<p class="last">We also support a rectangular iris in with &quot;irisin&quot; and a
rectangular iris out with &quot;irisout&quot;.</p>
</dd>
</dl>
<p>The following parameters are only respected if the mode is &quot;custom&quot;. Positions
are relative to the size of the screen, while the crops are relative to the
size of the image. So a crop of (0.25, 0.0, 0.5, 1.0) takes the middle
half of an image.</p>
<dl class="docutils">
<dt><cite>startcrop</cite></dt>
<dd>The starting rectangle that is cropped out of the
top image. A 4-element tuple containing x, y, width, and height.</dd>
<dt><cite>startpos</cite></dt>
<dd>The starting place that the top image is drawn
to the screen at, a 2-element tuple containing x and y.</dd>
<dt><cite>endcrop</cite></dt>
<dd>The ending rectangle that is cropped out of the
top image. A 4-element tuple containing x, y, width, and height.</dd>
<dt><cite>endpos</cite></dt>
<dd>The ending place that the top image is drawn
to the screen at, a 2-element tuple containing x and y.</dd>
<dt><cite>topnew</cite></dt>
<dd>If true, the scene that is cropped and moved (and is on top of
the other scene) is the new scene. If false, it is the old scene.</dd>
</dl>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">wiperight</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;wiperight&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">wipeleft</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;wipeleft&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">wipeup</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;wipeup&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">wipedown</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;wipedown&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideright</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideright&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideleft</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideleft&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideup</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideup&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slidedown</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slidedown&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideawayright</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideawayright&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideawayleft</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideawayleft&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideawayup</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideawayup&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">slideawaydown</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;slideawaydown&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">irisout</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;irisout&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">irisin</span> <span class="o">=</span> <span class="n">CropMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;irisin&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="Dissolve">
<code class="descname">Dissolve</code><span class="sig-paren">(</span><em>time</em>, <em>alpha=False</em>, <em>time_warp=None</em>, <em>**properties</em><span class="sig-paren">)</span><a class="headerlink" href="#Dissolve" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that dissolves from the old scene to the new scene.</p>
<dl class="docutils">
<dt><cite>time</cite></dt>
<dd>The time the dissolve will take.</dd>
<dt><cite>alpha</cite></dt>
<dd>Ignored.</dd>
<dt><cite>time_warp</cite></dt>
<dd>A function that adjusts the timeline. If not None, this should be a
function that takes a fractional time between 0.0 and 1.0, and returns
a number in the same range.</dd>
</dl>
<p>When the dissolve will be scaled to less than half its natural size, the
<a class="reference internal" href="style_properties.html#style-property-mipmap"><code class="xref std std-propref docutils literal notranslate"><span class="pre">mipmap</span></code></a> style property can be set to True. This will cause mipmaps
to be generated, which will make the dissolve consume more GPU resources,
but will reduce artifacts.</p>
</dd></dl>
<dl class="function">
<dt id="Fade">
<code class="descname">Fade</code><span class="sig-paren">(</span><em>out_time</em>, <em>hold_time</em>, <em>in_time</em>, <em>*</em>, <em>color=&quot;#000&quot;</em><span class="sig-paren">)</span><a class="headerlink" href="#Fade" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that takes <cite>out_time</cite> seconds to fade to
a screen filled with <cite>color</cite>, holds at that screen for <cite>hold_time</cite>
seconds, and then takes <cite>in_time</cite> to fade to then new screen.</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Fade to black and back.</span>
<span class="k">define</span> <span class="n">fade</span> <span class="o">=</span> <span class="n">Fade</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
<span class="c1"># Hold at black for a bit.</span>
<span class="k">define</span> <span class="n">fadehold</span> <span class="o">=</span> <span class="n">Fade</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
<span class="c1"># Camera flash - quickly fades to white, then back to the scene.</span>
<span class="k">define</span> <span class="n">flash</span> <span class="o">=</span> <span class="n">Fade</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="na">color</span><span class="o">=</span><span class="s2">&quot;#fff&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="ImageDissolve">
<code class="descname">ImageDissolve</code><span class="sig-paren">(</span><em>image</em>, <em>time</em>, <em>ramplen=8</em>, <em>reverse=False</em>, <em>alpha=True</em>, <em>time_warp=None</em>, <em>**properties</em><span class="sig-paren">)</span><a class="headerlink" href="#ImageDissolve" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that dissolves the old scene into the new scene, using
an image to control the dissolve process. This means that white pixels will
dissolve in first, and black pixels will dissolve in last.</p>
<dl class="docutils">
<dt><cite>image</cite></dt>
<dd>A control image to use. If <cite>config.gl2</cite> is True, then this can be any displayable,
else it needs to be either an image file or an image manipulator. The control image
should be the size of the scenes being dissolved, and if <cite>reverse=True</cite>,
it should be fully opaque.</dd>
<dt><cite>time</cite></dt>
<dd>The time the dissolve will take.</dd>
<dt><cite>ramplen</cite></dt>
<dd>The length of the ramp to use. This must be an integer power
of 2. When this is the default value of 8, when a white pixel
is fully dissolved, a pixel 8 shades of gray darker will have
completed one step of dissolving in.</dd>
<dt><cite>reverse</cite></dt>
<dd>If True, black pixels will dissolve in before white pixels.</dd>
<dt><cite>alpha</cite></dt>
<dd>Ignored.</dd>
<dt><cite>time_warp</cite></dt>
<dd>A function that adjusts the timeline. If not None, this should be a
function that takes a fractional time between 0.0 and 1.0, and returns
a number in the same range.</dd>
</dl>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">circirisout</span> <span class="o">=</span> <span class="n">ImageDissolve</span><span class="p">(</span><span class="s2">&quot;circiris.png&quot;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)</span>
<span class="k">define</span> <span class="n">circirisin</span> <span class="o">=</span> <span class="n">ImageDissolve</span><span class="p">(</span><span class="s2">&quot;circiris.png&quot;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">define</span> <span class="n">circiristbigramp</span> <span class="o">=</span> <span class="n">ImageDissolve</span><span class="p">(</span><span class="s2">&quot;circiris.png&quot;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="n">ramplen</span><span class="o">=</span><span class="mi">256</span><span class="p">)</span>
</pre></div>
</div>
<p>When the dissolve will be scaled to less than half its natural size, the
<a class="reference internal" href="style_properties.html#style-property-mipmap"><code class="xref std std-propref docutils literal notranslate"><span class="pre">mipmap</span></code></a> style property can be set to True. This will cause mipmaps
to be generated, which will make the dissolve consume more GPU resources,
but will reduce artifacts.</p>
</dd></dl>
<dl class="function">
<dt id="MoveTransition">
<code class="descname">MoveTransition</code><span class="sig-paren">(</span><em>delay, enter=None, leave=None, old=False, layers=['master'], time_warp=None, enter_time_warp=None, leave_time_warp=None</em><span class="sig-paren">)</span><a class="headerlink" href="#MoveTransition" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that interpolates the position of images (with the
same tag) in the old and new scenes.</p>
<dl class="docutils">
<dt><cite>delay</cite></dt>
<dd>The time it takes for the interpolation to finish.</dd>
<dt><cite>enter</cite></dt>
<dd>If not None, images entering the scene will also be moved. The value
of <cite>enter</cite> should be a transform that is applied to the image to
get its starting position.</dd>
<dt><cite>leave</cite></dt>
<dd>If not None, images leaving the scene will also be move. The value
of <cite>leave</cite> should be a transform that is applied to the image to
get its ending position.</dd>
<dt><cite>old</cite></dt>
<dd>If true, the old image will be used in preference to the new one.</dd>
<dt><cite>layers</cite></dt>
<dd>A list of layers that moves are applied to.</dd>
<dt><cite>time_warp</cite></dt>
<dd>A time warp function that's applied to the interpolation. This
takes a number between 0.0 and 1.0, and should return a number in
the same range.</dd>
<dt><cite>enter_time_warp</cite></dt>
<dd>A time warp function that's applied to images entering the scene.</dd>
<dt><cite>leave_time_warp</cite></dt>
<dd>A time warp function that's applied to images leaving the scene.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="MultipleTransition">
<code class="descname">MultipleTransition</code><span class="sig-paren">(</span><em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#MultipleTransition" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that allows multiple transitions to be displayed, one
after the other.</p>
<dl class="docutils">
<dt><cite>args</cite></dt>
<dd><p class="first">A <em>list</em> containing an odd number of items. The first, third, and
other odd-numbered items must be scenes, and the even items
must be transitions. A scene can be one of:</p>
<ul class="simple">
<li>A displayable.</li>
<li>False, to use the old scene.</li>
<li>True, to use the new scene.</li>
</ul>
<p class="last">Almost always, the first argument will be False and the last True.</p>
</dd>
</dl>
<p>The transitions in <cite>args</cite> are applied in order. For each transition,
the old scene is the screen preceding it, and the new scene is the
scene following it. For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">logodissolve</span> <span class="o">=</span> <span class="n">MultipleTransition</span><span class="p">([</span>
<span class="kc">False</span><span class="p">,</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">0.5</span><span class="p">),</span>
<span class="s2">&quot;logo.jpg&quot;</span><span class="p">,</span> <span class="n">Pause</span><span class="p">(</span><span class="mf">1.0</span><span class="p">),</span>
<span class="s2">&quot;logo.jpg&quot;</span><span class="p">,</span> <span class="n">dissolve</span><span class="p">,</span>
<span class="kc">True</span><span class="p">])</span>
</pre></div>
</div>
<p>This example will dissolve to logo.jpg, wait 1 second, and then
dissolve to the new scene.</p>
</dd></dl>
<dl class="function">
<dt id="Pause">
<code class="descname">Pause</code><span class="sig-paren">(</span><em>delay</em><span class="sig-paren">)</span><a class="headerlink" href="#Pause" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that only displays the new screen for <cite>delay</cite> seconds.
It can be useful as part of a MultipleTransition.</p>
</dd></dl>
<dl class="function">
<dt id="Pixellate">
<code class="descname">Pixellate</code><span class="sig-paren">(</span><em>time</em>, <em>steps</em><span class="sig-paren">)</span><a class="headerlink" href="#Pixellate" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that pixellates out the old screen, and then
pixellates in the new screen.</p>
<dl class="docutils">
<dt><cite>time</cite></dt>
<dd>The total time the transition will take, in seconds.</dd>
<dt><cite>steps</cite></dt>
<dd>The number of steps that will occur, in each direction. Each step
creates pixels about twice the size of those in the previous step,
so a 5-step pixellation will create 32x32 pixels.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="PushMove">
<code class="descname">PushMove</code><span class="sig-paren">(</span><em>time</em>, <em>mode=&quot;pushright&quot;</em><span class="sig-paren">)</span><a class="headerlink" href="#PushMove" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a transition that works by taking the new scene and using it to
&quot;push&quot; the old scene off the screen.</p>
<dl class="docutils">
<dt><cite>time</cite></dt>
<dd>The time the transition takes.</dd>
<dt><cite>mode</cite></dt>
<dd>There are four possible modes: &quot;pushright&quot;, &quot;pushleft&quot;, &quot;pushup&quot;,
and &quot;pushdown&quot;, which push the old scene off the screen in the
direction indicated.</dd>
</dl>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">pushright</span> <span class="o">=</span> <span class="n">PushMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;pushright&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">pushleft</span> <span class="o">=</span> <span class="n">PushMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;pushleft&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">pushup</span> <span class="o">=</span> <span class="n">PushMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;pushup&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">pushdown</span> <span class="o">=</span> <span class="n">PushMove</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span> <span class="s2">&quot;pushdown&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="Swing">
<code class="descname">Swing</code><span class="sig-paren">(</span><em>delay=1.0</em>, <em>vertical=False</em>, <em>reverse=False</em>, <em>background=&quot;#000&quot;</em>, <em>flatten=True</em><span class="sig-paren">)</span><a class="headerlink" href="#Swing" title="Permalink to this definition"> link</a></dt>
<dd><p>A transitions that rotates the old scene 90 degrees around an axis,
so that it is edge on with the viewer, switches to the new scene,
and then rotates that scene another 90 degrees to show the new
scene to the viewer.</p>
<dl class="docutils">
<dt><cite>delay</cite></dt>
<dd>How long the transition should take.</dd>
<dt><cite>vertical</cite></dt>
<dd>If true, the scene is rotate around the x-axis (pixels move
vertically). If false, the scene is roated around the y axis,
pixels moving horizontally.</dd>
<dt><cite>reverse</cite></dt>
<dd>When true, the rotation occurs in the reverse direction.</dd>
<dt><cite>background</cite></dt>
<dd>A displayable that is placed behind the scene as it rotates.</dd>
<dt><cite>flatten</cite></dt>
<dd>If true, the scenes are flattened into images the size of
the screen before being rotated. Use this if images being
not entirely on the screen causes undesired effects.</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="transition-families">
<h2>Transition Families<a class="headerlink" href="#transition-families" title="Permalink to this headline"> link</a></h2>
<p>Transition families are functions that define a large family of
related transitions.</p>
<dl class="function">
<dt id="define.move_transitions">
<code class="descclassname">define.</code><code class="descname">move_transitions</code><span class="sig-paren">(</span><em>prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False, layers=[u'master'], **kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#define.move_transitions" title="Permalink to this definition"> link</a></dt>
<dd><p>This defines a family of move transitions, similar to the move and ease
transitions. For a given <cite>prefix</cite>, this defines the transitions:</p>
<ul class="simple">
<li><em>prefix</em>- A transition that takes <cite>delay</cite> seconds to move images that
changed positions to their new locations.</li>
<li><em>prefix</em>inleft, <em>prefix</em>inright, <em>prefix</em>intop, <em>prefix</em>inbottom - Transitions
that take <cite>delay</cite> seconds to move images that changed positions to their
new locations, with newly shown images coming in from the appropriate
side.</li>
<li><em>prefix</em>outleft, <em>prefix</em>outright, <em>prefix</em>outtop, <em>prefix</em>outbottom -
Transitions that take <cite>delay</cite> seconds to move images that changed
positions to their new locations, with newly hidden images leaving via
the appropriate side.</li>
</ul>
<dl class="docutils">
<dt><cite>time_warp</cite>, <cite>in_time_warp</cite>, <cite>out_time_warp</cite></dt>
<dd><p class="first">Time warp functions that are given a time from 0.0 to 1.0 representing
the fraction of the move that is complete, and return a value in the same
range giving the fraction of a linear move that is complete.</p>
<p>This can be used to define functions that ease the images around,
rather than moving them at a constant speed.</p>
<p class="last">The three arguments are used for images remaining on the screen,
newly shown images, and newly hidden images, respectively.</p>
</dd>
<dt><cite>old</cite></dt>
<dd>If true, the transitions to move the old displayables, rather than the new ones.</dd>
<dt><cite>layers</cite></dt>
<dd>The layers the transition will apply to.</dd>
</dl>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># This defines all of the pre-defined transitions beginning</span>
<span class="c1"># with &quot;move&quot;.</span>
<span class="k">init</span> <span class="k">python</span><span class="p">:</span>
<span class="k">define</span><span class="o">.</span><span class="n">move_transitions</span><span class="p">(</span><span class="s2">&quot;move&quot;</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="section" id="dict-transitions">
<span id="id2"></span><h2>Dict Transitions<a class="headerlink" href="#dict-transitions" title="Permalink to this headline"> link</a></h2>
<p>In many places where Ren'Py takes a transition, it's possible to instead
specify a dictionary that maps layer names to this transition. When this
is the case, Ren'Py applies each transition to the appropriate layer.</p>
<p>When a dict is used, the pause that usually occurs when a transition takes
place does not occur. Instead, the statement taking the dictionary returns
immediately, and the transitions are scheduled to occur at the start of the
next interaction.</p>
<p>This can be used with the master layer to cause transitions to occur while
dialogue is being shown on the screen. For example, if we wrote:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">dis</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">&quot;master&quot;</span> <span class="p">:</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">1.0</span><span class="p">)</span> <span class="p">}</span>
</pre></div>
</div>
<p>and:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span>
<span class="k">with</span> <span class="n">dis</span>
<span class="n">e</span> <span class="s2">&quot;Hello, world.&quot;</span>
</pre></div>
</div>
<p>The dissolve will take place while the text is displayed on the screen.</p>
<p>Dict layer transitions can't be used every place a transition can be used,
only places where applying transitions to a layer is possible. It can be
used with the <code class="docutils literal notranslate"><span class="pre">with</span></code> statement and <code class="docutils literal notranslate"><span class="pre">with</span></code> cause of the scene, show, and
hide statements. It can also be used with <a class="reference internal" href="statement_equivalents.html#renpy.with_statement" title="renpy.with_statement"><code class="xref py py-func docutils literal notranslate"><span class="pre">renpy.with_statement()</span></code></a> and
<a class="reference internal" href="other.html#renpy.transition" title="renpy.transition"><code class="xref py py-func docutils literal notranslate"><span class="pre">renpy.transition()</span></code></a>, the <a class="reference internal" href="screen_actions.html#Show" title="Show"><code class="xref py py-func docutils literal notranslate"><span class="pre">Show()</span></code></a> and <a class="reference internal" href="screen_actions.html#Hide" title="Hide"><code class="xref py py-func docutils literal notranslate"><span class="pre">Hide()</span></code></a> actions, and
various config variables that take transitions. Dict layer transitions <em>will not</em>
work inside things that don't work with layers, such as ATL, <a class="reference internal" href="#ComposeTransition" title="ComposeTransition"><code class="xref py py-func docutils literal notranslate"><span class="pre">ComposeTransition()</span></code></a>
and <a class="reference internal" href="#MultipleTransition" title="MultipleTransition"><code class="xref py py-func docutils literal notranslate"><span class="pre">MultipleTransition()</span></code></a>.</p>
<p>This can interact poorly with statements that cause a transition to occur
themselves, like the transitions caused by <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span></code>. That can often be
solved with a second dict transition that applies to a different layer.
For example, if you are seeing weird blinking when the dialogue window shows
and hides, consider changing options.rpy to have:</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">window_show_transition</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">&quot;screens&quot;</span> <span class="p">:</span> <span class="n">Dissolve</span><span class="p">(</span><span class="o">.</span><span class="mi">25</span><span class="p">)</span> <span class="p">}</span>
<span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">window_hide_transition</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">&quot;screens&quot;</span> <span class="p">:</span> <span class="n">Dissolve</span><span class="p">(</span><span class="o">.</span><span class="mi">25</span><span class="p">)</span> <span class="p">}</span>
</pre></div>
</div>
<p>This works because the dialogue window exists entirely on the screens layer.</p>
</div>
<div class="section" id="see-also">
<h2>See Also<a class="headerlink" href="#see-also" title="Permalink to this headline"> link</a></h2>
<p><a class="reference internal" href="atl.html#atl-transitions"><span class="std std-ref">ATL Transitions</span></a>, <a class="reference internal" href="trans_trans_python.html#transitions-python"><span class="std std-ref">Transitions using Python</span></a> : how to
create transitions using the ATL system and Python, respectively</p>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; 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>