File: Rendering_Model.html

package info (click to toggle)
renpy 6.10.2.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,468 kB
  • ctags: 5,383
  • sloc: python: 17,801; ansic: 7,116; makefile: 127; sh: 15
file content (98 lines) | stat: -rw-r--r-- 8,531 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
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
<html><head><title>Rendering Model - 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> &#9702; <a href="Reference_Manual.html">reference manual</a> &#9702; <a href="Function_Index.html">function index</a></p><p><i><b>This page is a work in progress, and should not be considered authoritative.</b></i></p>
<table class="toc" id="toc" summary="Contents">
<tr>
<td>
<div id="toctitle">
<h2>Contents</h2>
</div>
<ul>
<li class="toclevel-1"><a href="#Rendering_Model"><span class="tocnumber">1</span> <span class="toctext">Rendering Model</span></a>
<ul>
<li class="toclevel-2"><a href="#Interactions"><span class="tocnumber">1.1</span> <span class="toctext">Interactions</span></a></li>
<li class="toclevel-2"><a href="#Scene_Lists"><span class="tocnumber">1.2</span> <span class="toctext">Scene Lists</span></a>
<ul>
<li class="toclevel-3"><a href="#Master_Layer"><span class="tocnumber">1.2.1</span> <span class="toctext">Master Layer</span></a></li>
<li class="toclevel-3"><a href="#Transient_Layer"><span class="tocnumber">1.2.2</span> <span class="toctext">Transient Layer</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Ordering"><span class="tocnumber">1.3</span> <span class="toctext">Ordering</span></a></li>
<li class="toclevel-2"><a href="#Drawing"><span class="tocnumber">1.4</span> <span class="toctext">Drawing</span></a></li>
<li class="toclevel-2"><a href="#Statements_and_Their_Behaviors"><span class="tocnumber">1.5</span> <span class="toctext">Statements and Their Behaviors</span></a>
<ul>
<li class="toclevel-3"><a href="#Scene_and_Show"><span class="tocnumber">1.5.1</span> <span class="toctext">Scene and Show</span></a></li>
<li class="toclevel-3"><a href="#with"><span class="tocnumber">1.5.2</span> <span class="toctext">with</span></a></li>
<li class="toclevel-3"><a href="#with_None"><span class="tocnumber">1.5.3</span> <span class="toctext">with None</span></a></li>
<li class="toclevel-3"><a href="#with_clause"><span class="tocnumber">1.5.4</span> <span class="toctext">with clause</span></a></li>
<li class="toclevel-3"><a href="#say"><span class="tocnumber">1.5.5</span> <span class="toctext">say</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</td>
</tr>
</table>
<script type="text/javascript">
//
 if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } 
//
</script>
<p><a id="Rendering_Model" name="Rendering_Model"></a></p>
<h1><span class="mw-headline">Rendering Model</span></h1>
<p>There are three main entities in the Ren'Py rendering model: the current scene list, the old scene list, and the screen. The first two need a bit of explanation, but the screen is just the thing rendered on the user's monitor.</p>
<p><a id="Interactions" name="Interactions"></a></p>
<h2><span class="mw-headline">Interactions</span></h2>
<p>Throughout this document, we'll refer to "interactions" with the user. An interaction is any contiguous time period, including of length zero, in which we either show something to the user, wait for and get the user's input, or both. Thus renpy.pause(0) causes a zero-length interaction in which we only show something to the user, while a say statement (a line of dialogue) starts an interaction that starts with drawing the dialogue to the screen and continues until the user clicks his mouse, which is potentially forever.</p>
<p><a id="Scene_Lists" name="Scene_Lists"></a></p>
<h2><span class="mw-headline">Scene Lists</span></h2>
<p>Scene lists are data structures with all of the information necessary to draw a scene to the screen. In particular, they have layers, each of which has an ordered list of images to display. There can be any number of layers, but by default there are two layers: the master layer and the transient layer.</p>
<p><a id="Master_Layer" name="Master_Layer"></a></p>
<h3><span class="mw-headline">Master Layer</span></h3>
<p>The master layer contains all of the images which typically span multiple interactions. The background image and character graphics will go on the master layer, for example.</p>
<p><a id="Transient_Layer" name="Transient_Layer"></a></p>
<h3><span class="mw-headline">Transient Layer</span></h3>
<p>The transient layer contains images which span only a single interaction with the user. The most common thing on the transient layer is rendered dialogue and narration.</p>
<p><a id="Ordering" name="Ordering"></a></p>
<h2><span class="mw-headline">Ordering</span></h2>
<p>For each layer, the images on it have a z-ordering. The user can explicitly specify the z-ordering of images, but more commonly they just get the implicit z-ordering of incrementing the z-order for every new image placed on the layer.</p>
<p><a id="Drawing" name="Drawing"></a></p>
<h2><span class="mw-headline">Drawing</span></h2>
<p>Drawing to the screen is performed during an interaction with the user, and only then.</p>
<p>As the interaction begins, if there is no transition specified, Ren'Py simply draws the current scene list to the screen.</p>
<p>If a transition is specified, Ren'Py starts the transition at the beginning of the interaction and goes until the transition is finished. Animations, by contrast, start at the beginning of the interaction and continue until the end of the interaction.</p>
<p>Once an interaction is finished, the current scene list is copied to the old scene list.</p>
<p><a id="Statements_and_Their_Behaviors" name="Statements_and_Their_Behaviors"></a></p>
<h2><span class="mw-headline">Statements and Their Behaviors</span></h2>
<p><a id="Scene_and_Show" name="Scene_and_Show"></a></p>
<h3><span class="mw-headline">Scene and Show</span></h3>
<p>The <a href="../reference/The_Ren%27Py_Language#scene" title="renpy/doc/reference/The Ren&apos;Py Language">scene statement</a> (if used to specify an image) and <a href="../reference/The_Ren%27Py_Language#show" title="renpy/doc/reference/The Ren&apos;Py Language">show statement</a> both (by default) place images on the master layer of the current scene list, but do not trigger an interaction. Thus you can think of them as queuing up images to display.</p>
<p><a id="with" name="with"></a></p>
<h3><span class="mw-headline">with</span></h3>
<p>The <a href="../reference/The_Ren%27Py_Language#with" title="renpy/doc/reference/The Ren&apos;Py Language">with statement</a> specifies a transition and causes an interaction. Technically, the user can click to prematurely terminate the transition, but otherwise the interaction caused by a with statement does not take user input.</p>
<p><a id="with_None" name="with_None"></a></p>
<h3><span class="mw-headline">with None</span></h3>
<p>The <a href="../reference/The_Ren%27Py_Language#with" title="renpy/doc/reference/The Ren&apos;Py Language">with statement</a> when given the argument of None is a special case. It does not cause an interaction, neither does it specify a transition. It merely copies the current scene list onto the old scene list and returns. (This can be used to transition from things that were never drawn into the screen.)</p>
<p><a id="with_clause" name="with_clause"></a></p>
<h3><span class="mw-headline">with clause</span></h3>
<p>A statement that has a with clause:</p>
<pre>
statement args <span class="kwa">with</span> transition
</pre>
<p>is equivalent to:</p>
<pre>
<span class="kwa">with None</span>
statement args
<span class="kwa">with</span> transition
</pre>
<p>And behaves exactly like that.</p>
<p><a id="say" name="say"></a></p>
<h3><span class="mw-headline">say</span></h3>
<p>The <a href="../reference/The_Ren%27Py_Language#say" title="renpy/doc/reference/The Ren&apos;Py Language">say statement</a> causes an interaction which last until the user terminates it (with the keyboard or mouse), except if auto-reading is enabled, in which case the interaction lasts for the auto-read duration. In particular, anything which was shown prior to a say statement will be displayed at the start of the say statement.</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>