File: renpy.hide.html

package info (click to toggle)
renpy 6.6.2.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 8,740 kB
  • ctags: 3,407
  • sloc: python: 22,153; ansic: 3,724; makefile: 138; lisp: 128; sh: 14
file content (55 lines) | stat: -rw-r--r-- 4,546 bytes parent folder | download
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
<html><head><title>renpy/doc/reference/functions/renpy.hide - 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> &#9702; <a href="../Reference_Manual.html">reference manual</a> &#9702; <a href="../Function_Index.html">function index</a></p><p><a id="renpy.hide" name="renpy.hide"></a></p>
<h1><span class="mw-headline">renpy.hide</span></h1>
<p><span id="renpy.hide" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">renpy.hide</strong></b></td>
<td valign="top">(name, layer='master'):</td>
</tr>
</table>
<div class="renpy-doc">
<p>This finds items in the given layer (or 'master' if no layer is given) that have the same name as the first component of the given name, and removes them from the layer. This is used to execute the hide statement.</p>
<p><i>name</i> - The name of the image to hide from the screen. This may be a tuple of strings, or a single string. In the latter case, it is split on whitespace to make a tuple. Only the first element of the tuple is used.</p>
<p><i>layer</i> - The layer this operates on.</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">python</span><span class="sym">:</span>
        renpy<span class="sym">.</span><span class="kwa">image</span><span class="sym">((</span><span class="str">'ctc'</span><span class="sym">,),</span> anim<span class="sym">.</span><span class="kwd">Blink</span><span class="sym">(</span><span class="str">"arrow.png"</span><span class="sym">))</span>
        <span class="kwa">for</span> slideindex <span class="kwa">in</span> <span class="kwb">range</span><span class="sym">(</span><span class="num">10</span><span class="sym">):</span>
            <span class="slc"># images are named slide0.png...slide9.png</span>
            renpy<span class="sym">.</span><span class="kwa">image</span><span class="sym">(</span><span class="str">'slide%d'</span> <span class="sym">%</span> slideindex<span class="sym">,</span>
                        <span class="str">'slide%d.png'</span> <span class="sym">%</span> slideindex<span class="sym">)</span>

<span class="str">"And now, a slideshow"</span>
<span class="kwa">python</span><span class="sym">:</span>
    <span class="kwa">for</span> slideindex <span class="kwa">in</span> <span class="kwb">range</span><span class="sym">(</span><span class="num">10</span><span class="sym">):</span>
        <span class="slc"># clear all images</span>
        renpy<span class="sym">.</span><span class="kwa">scene</span><span class="sym">()</span>

        renpy<span class="sym">.</span><span class="kwa">show</span><span class="sym">(</span><span class="str">'slide%d'</span> <span class="sym">%</span> slideindex<span class="sym">)</span>
        <span class="kwa">if</span> slideindex <span class="sym">%</span> <span class="num">2</span><span class="sym">:</span>
            renpy<span class="sym">.</span><span class="kwa">show</span><span class="sym">(</span><span class="str">'ctc'</span><span class="sym">,</span> at_list<span class="sym">=[</span>right<span class="sym">])</span>

        <span class="slc"># set the transition for the pause interaction</span>
        renpy<span class="sym">.</span><span class="kwd">transition</span><span class="sym">(</span>dissolve<span class="sym">)</span>

        renpy<span class="sym">.</span><span class="kwd">pause</span><span class="sym">(</span><span class="num">3.0</span><span class="sym">)</span>

        renpy<span class="sym">.</span><span class="kwa">hide</span><span class="sym">(</span><span class="str">'ctc'</span><span class="sym">)</span>

<span class="kwa">scene</span> bg washington
<span class="str">"Wasn't that nice?"</span>
</pre>
<p><i>Note: in 5.5.4, the renpy.image line should be: renpy.image(('slide%d'&#160;% slideindex,), 'slide%d.jpg'&#160;% slideindex)</i></p>
<p><br /></p>



<div class="visualClear" />
		<hr /><p class="docnav"><a href="../../index.html">documentation index</a> &#9702; <a href="../Reference_Manual.html">reference manual</a> &#9702; <a href="../Function_Index.html">function index</a></p></div>
	</body></html>