1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<html><head><title>renpy/doc/reference/functions/MoveTransition - Ren'Py</title><link href="../../shared.css" rel="stylesheet"><link href="../../monobook.css" rel="stylesheet"><link href="../../common.css" rel="stylesheet"><link href="../../monobook2.css" rel="stylesheet"><link href="../../docs.css" rel="stylesheet" /></link></link></link></link></head><body><div id="bodyContent">
<p class="docnav"><a href="../../index.html">documentation index</a> ◦ <a href="../Reference_Manual.html">reference manual</a> ◦ <a href="../Function_Index.html">function index</a></p><p><a id="MoveTransition" name="MoveTransition"></a></p>
<h1><span class="mw-headline">MoveTransition</span></h1>
<p><span id="MoveTransition" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">MoveTransition</strong></b></td>
<td valign="top">(delay, factory=None, enter_factory=None, leave_factory=None, old=False):</td>
</tr>
</table>
<div class="renpy-doc">
<p>This transition attempts to find images that have changed position, and moves them from the old position to the new transition, taking <i>delay</i> seconds to complete the move.</p>
<p>If <i>factory</i> is given, it is expected to be a function that takes as arguments: an old position, a new position, the delay, and a displayable, and to return a displayable as an argument. If not given, the default behavior is to move the displayable from the starting to the ending positions. Positions are always given as (xpos, ypos, xanchor, yanchor) tuples.</p>
<p>If <i>enter_factory</i> or <i>leave_factory</i> are given, they are expected to be functions that take as arguments a position, a delay, and a displayable, and return a displayable. They are applied to displayables that are entering or leaving the scene, respectively. The default is to show in place displayables that are entering, and not to show those that are leaving.</p>
<p>If <i>old</i> is True, then <i>factory</i> moves the old displayable with the given tag. Otherwise, it moves the new displayable with that tag. <i>(new in 6.6.1)</i></p>
<p>Images are considered to be the same if they have the same tag, in the same way that the tag is used to determine which image to replace or to hide. They are also considered to be the same if they are the same displayable.</p>
<p>If you use this transition to slide an image off the side of the screen, remember to hide it when you are done. (Or just use it with a leave_factory.)</p>
<p>There are several constructors that create functions for use with enter_factory and leave_factory:</p>
<p><span id="MoveFactory" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b>MoveFactory</b></td>
<td valign="top">(**kwargs):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Can be used with factory to supply arguments to <a href="../../reference/functions/Move.html" title="renpy/doc/reference/functions/Move">Move</a>.</p>
</div>
<p><span id="MoveIn" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b>MoveIn</b></td>
<td valign="top">(pos, **kwargs):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Can be used with enter_factory to move in entering elements.</p>
<p><i>pos</i> - An (xpos, ypos, xanchor, yanchor) tuple, giving the position to move from. Any component can be None, to take the corresponding component of the final position.</p>
<p>Keyword arguments are passed to <a href="../../reference/functions/Move.html" title="renpy/doc/reference/functions/Move">Move</a>.</p>
</div>
<p><span id="MoveIn" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b>MoveIn</b></td>
<td valign="top">(pos, **kwargs):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Can be used with leave_factory to move in entering elements.</p>
<p><i>pos</i> - An (xpos, ypos, xanchor, yanchor) tuple, giving the position to move to. Any component can be None, to take the corresponding component of the original position.</p>
<p>Keyword arguments are passed to <a href="../../reference/functions/Move.html" title="renpy/doc/reference/functions/Move">Move</a>.</p>
</div>
<p><span id="ZoomInOut" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b>ZoomInOut</b></td>
<td valign="top">(start, end, **kwargs):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Can be used with enter_factory or leave_factory. Used to zoom in or out entering or leaving displayables.</p>
<p><i>start</i> - The zoom factor at the start of the transition.</p>
<p><i>end</i> - The zoom factor at the end of the transition.</p>
<p>Keyword arguments are passed to <a href="../../reference/functions/FactorZoom.html" title="renpy/doc/reference/functions/FactorZoom">FactorZoom</a>.</p>
</div>
<p><span id="RevolveInOut" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b>RevolveInOut</b></td>
<td valign="top">(start, end, **kwargs):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Can be used with enter_factory or leave_factory. Used to revolve in or out entering or leaving displayables.</p>
<p><i>start</i> - The clockwise revolution at the start of the transition.</p>
<p><i>end</i> - The clockwise revolution at the end of the transition.</p>
<p>Additional keyword arguments are passed to <a href="../../reference/functions/Revolve.html" title="renpy/doc/reference/functions/Revolve">Revolve</a>.</p>
</div>
</div>
<p><a id="Example" name="Example"></a></p>
<h2><span class="mw-headline">Example</span></h2>
<pre>
<span class="kwa">init</span><span class="sym">:</span>
$ move <span class="sym">=</span> <span class="kwd">MoveTransition</span><span class="sym">(</span><span class="num">0.5</span><span class="sym">)</span>
e <span class="str">"The move transition moves around images that have</span>
<span class="str"> changed position."</span>
e <span class="str">"For example..."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> offscreenleft <span class="kwa">with</span> move
e <span class="str">"I can move over to the offscreenleft position, just off</span>
<span class="str"> the left side of the screen."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> left <span class="kwa">with</span> move
e <span class="str">"The left position has my left side border the left</span>
<span class="str"> margin of the screen."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> center <span class="kwa">with</span> move
e <span class="str">"I can also move to the center..."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> right <span class="kwa">with</span> move
e <span class="str">"... the right ..."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> offscreenright <span class="kwa">with</span> move
e <span class="str">"... or even to offscreenright, off the right-hand side</span>
<span class="str"> of the screen."</span>
<span class="kwa">show</span> eileen happy <span class="kwa">at</span> right <span class="kwa">with</span> move
e <span class="str">"We don't limit you to these five positions either. You</span>
<span class="str"> can always create your own Position objects."</span>
</pre>
<div class="visualClear" />
<hr /><p class="docnav"><a href="../../index.html">documentation index</a> ◦ <a href="../Reference_Manual.html">reference manual</a> ◦ <a href="../Function_Index.html">function index</a></p></div>
</body></html>
|