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
|
<html><head><title>renpy/doc/reference/functions/LiveComposite - 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="LiveComposite" name="LiveComposite"></a></p>
<h1><span class="mw-headline">LiveComposite</span></h1>
<p><span id="LiveComposite" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">LiveComposite</strong></b></td>
<td valign="top">(size, *args, **properties):</td>
</tr>
</table>
<div class="renpy-doc">
<p>This is similar to <a href="../../reference/functions/im.Composite.html" title="renpy/doc/reference/functions/im.Composite">im.Composite</a>, but can be used with displayables instead of images. This allows it to be used to composite, for example, an animation on top of the image.</p>
<p>This is less efficient than <a href="../../reference/functions/im.Composite.html" title="renpy/doc/reference/functions/im.Composite">im.Composite</a>, as it needs to draw all of the displayables on the screen. On the other hand, it allows displayables to change while they are on the screen, which is necessary for animation.</p>
<p>This takes a variable number of arguments. The first argument is size, which must be a tuple giving the width and height of the composited widgets, for layout purposes.</p>
<p>It then takes an even number of further arguments. (For an odd number of total arguments.) The second and other even numbered arguments contain position tuples, while the third and further odd-numbered arguments give displayables. A position argument gives the position of the displayable immediately following it, with the position expressed as a tuple giving an offset from the upper-left corner of the LiveComposite. The displayables are drawn in bottom-to-top order, with the last being closest to the user.</p>
</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>
<span class="kwa">image</span> cyan livecomposite <span class="sym">=</span> <span class="kwd">LiveComposite</span><span class="sym">((</span><span class="num">200</span><span class="sym">,</span> <span class="num">300</span><span class="sym">),</span>
<span class="sym">(</span><span class="num">0</span><span class="sym">,</span> <span class="num">0</span><span class="sym">),</span> anim<span class="sym">.</span><span class="kwd">Blink</span><span class="sym">(</span><span class="kwd">Image</span><span class="sym">(</span><span class="str">"cyan.png"</span><span class="sym">)),</span>
<span class="sym">(</span><span class="num">0</span><span class="sym">,</span> <span class="num">50</span><span class="sym">),</span> <span class="str">"cyan.png"</span><span class="sym">,</span>
<span class="sym">(</span><span class="num">0</span><span class="sym">,</span> <span class="num">100</span><span class="sym">),</span> <span class="str">"cyan.png"</span><span class="sym">)</span>
<span class="kwa">show</span> cyan livecomposite <span class="kwa">at</span> cyanpos <span class="kwa">with</span> dissolve
</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>
|