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

454 lines
31 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>Side Images &#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="Image Gallery, Music Room, and Replay Actions" href="rooms.html" />
<link rel="prev" title="Text Input" href="input.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>
<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>
<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 class="current">
<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 current"><a class="current reference internal" href="#">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="#">Side Images</a><ul>
<li><a class="reference internal" href="#invisible-characters">Invisible Characters</a></li>
<li><a class="reference internal" href="#config-and-store-variables">Config and Store Variables</a></li>
<li><a class="reference internal" href="#transforms-and-transitions">Transforms and Transitions</a></li>
<li><a class="reference internal" href="#functions">Functions</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-9 content">
<div class="section" id="side-images">
<h1>Side Images<a class="headerlink" href="#side-images" title="Permalink to this headline"> link</a></h1>
<p>Many visual novels include a picture of the character that is speaking as
part of their interface. Ren'Py calls this image a side image, and has
support for automatically selecting and displaying a side image as part
of the dialogue.</p>
<p>The side image support assumes that a <a class="reference internal" href="dialogue.html#Character" title="Character"><code class="xref py py-func docutils literal notranslate"><span class="pre">Character()</span></code></a> is declared with
a linked image tag:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">&quot;Eileen&quot;</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">&quot;eileen&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>When a character with a linked image tag speaks, Ren'Py creates a pool of
image attributes. The linked image tag is added to this pool, as are the
current image attributes that are associated with that tag.</p>
<p>In addition to the tag, there must be at least one attribute in the pool.
If not, no side image is shown.</p>
<p>To determine the side image associated with a tag, Ren'Py tries to find
an image with the tag &quot;side&quot;, and the largest number of attributes from
the pool. If no image can be found, or more than one image has the same
number of attributes, a <a class="reference internal" href="displayables.html#Null" title="Null"><code class="xref py py-class docutils literal notranslate"><span class="pre">Null</span></code></a> is shown instead.</p>
<p>For example, say we have the following script:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">&quot;Eileen&quot;</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">&quot;eileen&quot;</span><span class="p">)</span>
<span class="k">image</span> <span class="n">eileen</span> <span class="n">happy</span> <span class="o">=</span> <span class="s2">&quot;eileen_happy.png&quot;</span>
<span class="k">image</span> <span class="n">eileen</span> <span class="n">concerned</span> <span class="o">=</span> <span class="s2">&quot;eileen_concerned.png&quot;</span>
<span class="k">image</span> <span class="k">side</span> <span class="n">eileen</span> <span class="n">happy</span> <span class="o">=</span> <span class="s2">&quot;side_eileen_happy.png&quot;</span>
<span class="k">image</span> <span class="k">side</span> <span class="n">eileen</span> <span class="o">=</span> <span class="s2">&quot;side_eileen.png&quot;</span>
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span>
<span class="n">e</span> <span class="s2">&quot;Let&#39;s call this line Point A.&quot;</span>
<span class="n">e</span> <span class="n">concerned</span> <span class="s2">&quot;And this one is point B.&quot;</span>
</pre></div>
</div>
<p>At point A, the character <code class="docutils literal notranslate"><span class="pre">e</span></code> is speaking, which is linked to the image
tag &quot;eileen&quot;. The &quot;eileen happy&quot; image is showing, so the pool of attributes
is &quot;eileen&quot; and &quot;happy&quot;. We look for an image with the &quot;side&quot; tag, and as
many of those attributes as possible and we match &quot;side eileen happy&quot;,
which is the side image Ren'Py will display.</p>
<p>At point B, the &quot;eileen concerned&quot; image is showing. The pool of attributes
is now &quot;eileen&quot; and &quot;concerned&quot;. The only matching image is &quot;side eileen&quot;,
so that's what Ren'Py selects. If there was a &quot;side concerned&quot; image, there
would be ambiguity, and Ren'Py wouldn't display an image.</p>
<div class="section" id="invisible-characters">
<h2>Invisible Characters<a class="headerlink" href="#invisible-characters" title="Permalink to this headline"> link</a></h2>
<p>Another use of the side image is to show an image of the player character,
when that character has dialogue. The way to do this is to link an image to
the character, and then use the say with attributes construct to select
the side image to show.</p>
<p>For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">p</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">&quot;Player&quot;</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">&quot;player&quot;</span><span class="p">)</span>
<span class="k">image</span> <span class="k">side</span> <span class="n">player</span> <span class="n">happy</span> <span class="o">=</span> <span class="s2">&quot;side_player_happy.png&quot;</span>
<span class="k">image</span> <span class="k">side</span> <span class="n">player</span> <span class="n">concerned</span> <span class="o">=</span> <span class="s2">&quot;side_player_concerned.png&quot;</span>
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="n">p</span> <span class="n">happy</span> <span class="s2">&quot;This is shown with the &#39;side player happy&#39; image.&quot;</span>
<span class="n">p</span> <span class="s2">&quot;This is also shown with &#39;side player happy&#39;.&quot;</span>
<span class="n">p</span> <span class="n">concerned</span> <span class="s2">&quot;This is shown with &#39;side player concerned&#39;.&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="config-and-store-variables">
<h2>Config and Store Variables<a class="headerlink" href="#config-and-store-variables" title="Permalink to this headline"> link</a></h2>
<p>There are a number of attributes of side images that can be controlled
using config variables.</p>
<dl class="var">
<dt id="var-_side_image_tag">
<code class="descname">_side_image_tag</code> = None<a class="headerlink" href="#var-_side_image_tag" title="Permalink to this definition"> link</a></dt>
<dd></dd></dl>
<dl class="var">
<dt id="var-config.side_image_tag">
define <code class="descname">config.side_image_tag</code> = None<a class="headerlink" href="#var-config.side_image_tag" title="Permalink to this definition"> link</a></dt>
<dd><p>If _side_image_tag is not None, it takes preference over config.side_image_tag.</p>
<p>If this is given, then the side image will track the given image tag,
rather than the image associated with currently speaking character. For example,</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">&quot;Eileen&quot;</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">&quot;eileen&quot;</span><span class="p">)</span>
<span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">side_image_tag</span> <span class="o">=</span> <span class="s2">&quot;eileen&quot;</span>
</pre></div>
</div>
<p>Will make the side image track the &quot;eileen&quot; image tag, which is associated
with the <code class="docutils literal notranslate"><span class="pre">e</span></code> character.</p>
</dd></dl>
<dl class="var">
<dt id="var-config.side_image_only_not_showing">
define <code class="descname">config.side_image_only_not_showing</code> = False<a class="headerlink" href="#var-config.side_image_only_not_showing" title="Permalink to this definition"> link</a></dt>
<dd><p>When set to true, the side image will only show if an image with that tag
is not already being shown on the screen.</p>
</dd></dl>
<dl class="var">
<dt id="var-_side_image_prefix_tag">
<code class="descname">_side_image_prefix_tag</code> = None<a class="headerlink" href="#var-_side_image_prefix_tag" title="Permalink to this definition"> link</a></dt>
<dd></dd></dl>
<dl class="var">
<dt id="var-config.side_image_prefix_tag">
define <code class="descname">config.side_image_prefix_tag</code> = 'side'<a class="headerlink" href="#var-config.side_image_prefix_tag" title="Permalink to this definition"> link</a></dt>
<dd><p>If _side_image_prefix_tag is not None, it takes preference over
config.side_image_prefix_tag.</p>
<p>The prefix that is used when searching for a side image.</p>
</dd></dl>
<dl class="var">
<dt id="var-config.side_image_null">
define <code class="descname">config.side_image_null</code> = Null()<a class="headerlink" href="#var-config.side_image_null" title="Permalink to this definition"> link</a></dt>
<dd><p>The Null displayable to use when not displaying a side image. This can
be changed, but only to other Null objects. One reason for doing so
would be to set the side of the Null (eg. <code class="docutils literal notranslate"><span class="pre">Null(width=200,</span> <span class="pre">height=150)</span></code>)
to prevent dissolves from being cut off.</p>
</dd></dl>
<dl class="var">
<dt id="var-config.side_image_same_transform">
define <code class="descname">config.side_image_same_transform</code> = None<a class="headerlink" href="#var-config.side_image_same_transform" title="Permalink to this definition"> link</a></dt>
<dd><p>If not None, a transform that is used when the new side image shares the
same image tag as the previous side image.</p>
</dd></dl>
<dl class="var">
<dt id="var-config.side_image_change_transform">
define <code class="descname">config.side_image_change_transform</code> = None<a class="headerlink" href="#var-config.side_image_change_transform" title="Permalink to this definition"> link</a></dt>
<dd><p>If not None, a transform that is used when the new side image does not
share the name image tag (or one of the new or old side images does not
exist).</p>
</dd></dl>
</div>
<div class="section" id="transforms-and-transitions">
<h2>Transforms and Transitions<a class="headerlink" href="#transforms-and-transitions" title="Permalink to this headline"> link</a></h2>
<p>The <a class="reference internal" href="#var-config.side_image_same_transform"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.side_image_same_transform</span></code></a> and
<a class="reference internal" href="#var-config.side_image_change_transform"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.side_image_change_transform</span></code></a> transforms are called with two
arguments old and new side image displayables each time the side
image is displayed. These can be used to move around side images, or
use a transition to go between side images.</p>
<p>This causes the side image to slide in and out when the character
associated with that image changes:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">transform</span> <span class="n">change_transform</span><span class="p">(</span><span class="k">old</span><span class="p">,</span> <span class="k">new</span><span class="p">):</span>
<span class="k">contains</span><span class="p">:</span>
<span class="k">old</span>
<span class="na">yalign</span> <span class="mf">1.0</span>
<span class="na">xpos</span> <span class="mf">0.0</span> <span class="na">xanchor</span> <span class="mf">0.0</span>
<span class="n">linear</span> <span class="mf">0.2</span> <span class="na">xanchor</span> <span class="mf">1.0</span>
<span class="k">contains</span><span class="p">:</span>
<span class="k">new</span>
<span class="na">yalign</span> <span class="mf">1.0</span>
<span class="na">xpos</span> <span class="mf">0.0</span> <span class="na">xanchor</span> <span class="mf">1.0</span>
<span class="n">linear</span> <span class="mf">0.2</span> <span class="na">xanchor</span> <span class="mf">0.0</span>
<span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">side_image_change_transform</span> <span class="o">=</span> <span class="n">change_transform</span>
</pre></div>
</div>
<p>This is used to dissolve between old and new side images when the
character remains the same. (For example, when the character changes
emotion.) For the <a class="reference internal" href="transitions.html#Dissolve" title="Dissolve"><code class="xref py py-class docutils literal notranslate"><span class="pre">Dissolve</span></code></a> to work correctly, both side images must
be the same size.</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">transform</span> <span class="n">same_transform</span><span class="p">(</span><span class="k">old</span><span class="p">,</span> <span class="k">new</span><span class="p">):</span>
<span class="k">old</span>
<span class="k">new</span> <span class="k">with</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">0.2</span><span class="p">,</span> <span class="na">alpha</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">side_image_same_transform</span> <span class="o">=</span> <span class="n">same_transform</span>
</pre></div>
</div>
<p>When the <a class="reference internal" href="screen_actions.html#SideImage" title="SideImage"><code class="xref py py-func docutils literal notranslate"><span class="pre">SideImage()</span></code></a> is scaled down, it might make sense to enable
mipmapping in the <a class="reference internal" href="transitions.html#Dissolve" title="Dissolve"><code class="xref py py-func docutils literal notranslate"><span class="pre">Dissolve()</span></code></a>:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">transform</span> <span class="n">same_transform</span><span class="p">(</span><span class="k">old</span><span class="p">,</span> <span class="k">new</span><span class="p">):</span>
<span class="k">old</span>
<span class="k">new</span> <span class="k">with</span> <span class="n">Dissolve</span><span class="p">(</span><span class="mf">0.2</span><span class="p">,</span> <span class="na">alpha</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="na">mipmap</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">define</span> <span class="n">config</span><span class="o">.</span><span class="n">side_image_same_transform</span> <span class="o">=</span> <span class="n">same_transform</span>
</pre></div>
</div>
</div>
<div class="section" id="functions">
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"> link</a></h2>
<dl class="function">
<dt id="renpy.get_side_image">
<code class="descclassname">renpy.</code><code class="descname">get_side_image</code><span class="sig-paren">(</span><em>prefix_tag</em>, <em>image_tag=None</em>, <em>not_showing=None</em>, <em>layer=None</em><span class="sig-paren">)</span><a class="headerlink" href="#renpy.get_side_image" title="Permalink to this definition"> link</a></dt>
<dd><p>This attempts to find an image to show as the side image.</p>
<p>It begins by determining a set of image attributes. If <cite>image_tag</cite> is
given, it gets the image attributes from the tag. Otherwise, it gets
them from the currently showing character. If no attributes are available
for the tag, this returns None.</p>
<p>It then looks up an image with the tag <cite>prefix_tag</cite>, and the image tage (either
from <cite>image_tag</cite> or the currently showing character) and the set of image
attributes as attributes. If such an image exists, it's returned.</p>
<p>If not_showing is True, this only returns a side image if the image the
attributes are taken from is not on the screen. If Nome, the value
is taken from <a class="reference internal" href="#var-config.side_image_only_not_showing"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.side_image_only_not_showing</span></code></a>.</p>
<p>If <cite>layer</cite> is None, uses the default layer for the currently showing
tag.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.set_tag_attributes">
<code class="descclassname">renpy.</code><code class="descname">set_tag_attributes</code><span class="sig-paren">(</span><em>name</em>, <em>layer=None</em><span class="sig-paren">)</span><a class="headerlink" href="#renpy.set_tag_attributes" title="Permalink to this definition"> link</a></dt>
<dd><p>This sets the attributes associated with an image tag when that image
tag is not showing. The main use of this would be to directly set the
attributes used by a side image.</p>
<p>For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">$</span> <span class="n">renpy</span><span class="o">.</span><span class="n">set_tag_attributes</span><span class="p">(</span><span class="s2">&quot;lucy mad&quot;</span><span class="p">)</span>
<span class="k">$</span> <span class="n">renpy</span><span class="o">.</span><span class="n">say</span><span class="p">(</span><span class="n">l</span><span class="p">,</span> <span class="s2">&quot;I&#39;m rather cross.&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>and:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">l</span> <span class="n">mad</span> <span class="s2">&quot;I&#39;m rather cross.&quot;</span>
</pre></div>
</div>
<p>are equivalent.</p>
</dd></dl>
</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>