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
|
<html><head><title>Zoom - Ren'Py Visual Novel Engine</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="Zoom" name="Zoom"></a></p>
<h1><span class="mw-headline">Zoom</span></h1>
<p><span id="Zoom" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">Zoom</strong></b></td>
<td valign="top">(size, start, end, time, after_child=None, time_warp=None, bilinear=True, opaque=True, anim_timebase=False, repeat=False, **properties):</td>
</tr>
</table>
<div class="renpy-doc">
<p>This causes a zoom to take place, using image scaling. When used as an `at` clause, this creates a displayable. The render of this displayable is always of the supplied size. The child displayable is rendered, and a rectangle is cropped out of it. This rectangle is interpolated between the start and end rectangles. The rectangle is then scaled to the supplied size. The zoom will take <i>time</i> seconds, after which it will show the end rectangle, unless an <i>after_child</i> is given.</p>
<p>The start and end rectangles must fit completely inside the size of the child, otherwise an error will occur.</p>
<p><i>size</i> - The size that the rectangle is scaled to, a (width, height) tuple.</p>
<p><i>start</i> - The start rectangle, an (xoffset, yoffset, width, height) tuple.</p>
<p><i>end</i> - The end rectangle, an (xoffset, yoffset, width, height) tuple.</p>
<p><i>time</i> - The amount of time it will take to interpolate from the start to the end rectangle.</p>
<p><i>after_child</i> - If present, a second child widget. This displayable will be rendered after the zoom completes. Use this to snap to a sharp displayable after the zoom is done.</p>
<p><i>time_warp</i> - If not None, a function that takes a fractional period (between 0.0 and 0.1), and returns a fractional period. Use this to implement non-linear zooms. This function may be pickled, so it cannot be a lambda or other non-top-level function.</p>
<p><i>bilinear</i> - If True, the default, this will use bilinear filtering. If false, this will use ugly yet fast nearest neighbor filtering.</p>
<p><i>opaque</i> - If True and bilinear is True, this will use a very efficient method that does not support transparency. If False, this supports transparency, but is less efficient.</p>
<p><i>anim_timebase</i> - is true to use the animation timebase, false to use the displayable timebase.</p>
<p><i>repeat</i> - causes the zoom to repeat every <i>time</i> seconds.</p>
</div>
<p><a id="Example" name="Example"></a></p>
<h2><span class="mw-headline">Example</span></h2>
<pre>
<span class="kwa">scene</span> bg whitehouse <span class="kwa">at</span> <span class="kwd">Zoom</span><span class="sym">((</span><span class="num">800</span><span class="sym">,</span> <span class="num">600</span><span class="sym">), (</span><span class="num">0</span><span class="sym">,</span> <span class="num">0</span><span class="sym">,</span> <span class="num">800</span><span class="sym">,</span> <span class="num">600</span><span class="sym">), (</span><span class="num">225</span><span class="sym">,</span> <span class="num">150</span><span class="sym">,</span> <span class="num">400</span><span class="sym">,</span> <span class="num">300</span><span class="sym">),</span> <span class="num">1.0</span><span class="sym">)</span>
<span class="str">"We can zoom into images..."</span>
<span class="kwa">scene</span> bg whitehouse <span class="kwa">at</span> <span class="kwd">Zoom</span><span class="sym">((</span><span class="num">800</span><span class="sym">,</span> <span class="num">600</span><span class="sym">), (</span><span class="num">225</span><span class="sym">,</span> <span class="num">150</span><span class="sym">,</span> <span class="num">400</span><span class="sym">,</span> <span class="num">300</span><span class="sym">), (</span><span class="num">0</span><span class="sym">,</span> <span class="num">0</span><span class="sym">,</span> <span class="num">800</span><span class="sym">,</span> <span class="num">600</span><span class="sym">),</span> <span class="num">1.0</span><span class="sym">)</span>
<span class="str">"... and zoom back out of them again."</span>
</pre>
<p><br /></p>
<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>
|