File: transforms.html

package info (click to toggle)
renpy 6.17.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 60,588 kB
  • ctags: 39,731
  • sloc: python: 29,967; ansic: 5,162; makefile: 167; sh: 2
file content (259 lines) | stat: -rw-r--r-- 11,971 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259

<!DOCTYPE html>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Transforms &mdash; Ren&#39;Py Documentation</title>
    <link rel="stylesheet" href="_static/screen.css" type="text/css" media="screen, projection"/>
    <link rel="stylesheet" href="_static/renpydoc.css" type="text/css" media="print" />

    <!--[if lt IE 8]>
    <link rel="stylesheet" href="_static/renpydoc.css" type="text/css" media="screen, projection"/>
    <![endif]-->

    <link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.18.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Ren&#39;Py Documentation" href="index.html" />
    <link rel="next" title="Transitions" href="transitions.html" />
    <link rel="prev" title="Displayables" href="displayables.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="transitions.html" title="Transitions"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="displayables.html" title="Displayables"
             accesskey="P">previous</a> |</li>

        <li> <img src="_static/logo.png" width=19 height=21 align=center> 
        <li> <a href="http://www.renpy.org/">Ren'Py Home</a> |
        <li><a href="index.html">Ren&#39;Py Documentation</a></li> 
      </ul>
    </div>
  <div class="container">
  <div class="span4">
    
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Transforms</a><ul>
<li><a class="reference internal" href="#default-transforms">Default Transforms</a></li>
<li><a class="reference internal" href="#creator-defined-transforms">Creator-Defined Transforms</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="displayables.html"
                        title="previous chapter">Displayables</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="transitions.html"
                        title="next chapter">Transitions</a></p>
            <h4>Search</h4>
            
            <div id="cse-search-form" style="width: 100%;"></div>

      <div class="copydata">
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
    <br>
      </div>
        </div>
      </div>
  
  </div>
  
    
    <div class="document span20 last">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="transforms">
<span id="id1"></span><h1>Transforms<a class="headerlink" href="#transforms" title="Permalink to this headline">¶</a></h1>
<p>A transform can be applied to a displayable to yield another
displayable. The built-in transforms are used to control where an
object is placed on the screen, while user-defined transforms
can cause more complex effects, like motion, zoom, and rotation.</p>
<p>Transforms can be applied by giving the at clause to the scene and
show statements. The following code applies the &quot;right&quot; transform to
the eileen happy displayable.:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span> <span class="k">at</span> <span class="n">right</span>
</pre></div>
</div>
<p>Multiple transforms can be applied by separating them with commas. These
transforms are applied from left-to-right, with the rightmost
transform taking precendece in the case of conflicts.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span> <span class="k">at</span> <span class="n">halfsize</span><span class="p">,</span> <span class="n">right</span>
</pre></div>
</div>
<p>A displayable always has a transform associated with it. If no
transform is given, the prior transform is used. When the transform is
changed, undefined values are taken from the prior transform, or from
<tt class="docutils literal"><span class="pre">default</span></tt> if there is no prior transform.</p>
<div class="section" id="default-transforms">
<h2>Default Transforms<a class="headerlink" href="#default-transforms" title="Permalink to this headline">¶</a></h2>
<p>Ren'Py ships with a number of transforms defined by default. These
transforms position things on the screen. Here's a depiction of where
each default transform will position an image.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="o">+-----------------------------------------------------------+</span>
<span class="o">|</span><span class="n">topleft</span><span class="p">,</span> <span class="n">reset</span>               <span class="n">top</span>                   <span class="n">topright</span><span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                          <span class="n">truecenter</span>                       <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span>                                                           <span class="o">|</span>
<span class="o">|</span><span class="n">left</span>                   <span class="n">center</span><span class="p">,</span> <span class="na">default</span>                <span class="n">right</span><span class="o">|</span>
<span class="o">+-----------------------------------------------------------+</span>
</pre></div>
</div>
<p>The offscreenleft and offscreenright transforms position images off the
screen. These transforms can be used to move things off the screen
(remember to hide them afterwards, to ensure that they do not consume
resources).</p>
<p>The transforms are:</p>
<dl class="var">
<dt id="var-center">
<tt class="descname">center</tt><a class="headerlink" href="#var-center" title="Permalink to this definition">¶</a></dt>
<dd><p>Centers horizontally, and aligns to the bottom of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-default">
<tt class="descname">default</tt><a class="headerlink" href="#var-default" title="Permalink to this definition">¶</a></dt>
<dd><p>Centers horizontally, and aligns to the bottom of the screen. This
can be redefined to change the default placement of images shown
with the show or scene statements.</p>
</dd></dl>

<dl class="var">
<dt id="var-left">
<tt class="descname">left</tt><a class="headerlink" href="#var-left" title="Permalink to this definition">¶</a></dt>
<dd><p>Aligns to the bottom-left corner of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-offscreenleft">
<tt class="descname">offscreenleft</tt><a class="headerlink" href="#var-offscreenleft" title="Permalink to this definition">¶</a></dt>
<dd><p>Places the displayable off the left side of the screen,
aligned to the bottom of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-offscreenright">
<tt class="descname">offscreenright</tt><a class="headerlink" href="#var-offscreenright" title="Permalink to this definition">¶</a></dt>
<dd><p>Places the displayable off the left side of the screen,
aligned to the bottom of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-reset">
<tt class="descname">reset</tt><a class="headerlink" href="#var-reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Resets the transform. Places the displayable in the top-left
corner of the scren, and also eliminates any zoom, rotation, or
other effects.</p>
</dd></dl>

<dl class="var">
<dt id="var-right">
<tt class="descname">right</tt><a class="headerlink" href="#var-right" title="Permalink to this definition">¶</a></dt>
<dd><p>Aligns to the bottom-right corner of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-top">
<tt class="descname">top</tt><a class="headerlink" href="#var-top" title="Permalink to this definition">¶</a></dt>
<dd><p>Centers horizontally, and aligns to the top of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-topleft">
<tt class="descname">topleft</tt><a class="headerlink" href="#var-topleft" title="Permalink to this definition">¶</a></dt>
<dd><p>Aligns to the top-left corner of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-topright">
<tt class="descname">topright</tt><a class="headerlink" href="#var-topright" title="Permalink to this definition">¶</a></dt>
<dd><p>Aligns to the top-right corner of the screen.</p>
</dd></dl>

<dl class="var">
<dt id="var-truecenter">
<tt class="descname">truecenter</tt><a class="headerlink" href="#var-truecenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Centers both horizontally and vertically.</p>
</dd></dl>

</div>
<div class="section" id="creator-defined-transforms">
<h2>Creator-Defined Transforms<a class="headerlink" href="#creator-defined-transforms" title="Permalink to this headline">¶</a></h2>
<p>A creator can define a transform using the
<a class="reference internal" href="atl.html#atl"><em>animation and transformation language</em></a>, or the
<a class="reference internal" href="trans_trans_python.html#Transform" title="Transform"><tt class="xref py py-class docutils literal"><span class="pre">Transform</span></tt></a> function.</p>
</div>
</div>


          </div>
        </div>
      </div>
    </div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="transitions.html" title="Transitions"
             >next</a> |</li>
        <li class="right" >
          <a href="displayables.html" title="Displayables"
             >previous</a> |</li>

        <li> <img src="_static/logo.png" width=19 height=21 align=center> 
        <li> <a href="http://www.renpy.org/">Ren'Py Home</a> |
        <li><a href="index.html">Ren&#39;Py Documentation</a></li> 
      </ul>
    </div>


	<script src="http://www.google.com/jsapi" type="text/javascript"></script>
	<script type="text/javascript"> 
	  google.load('search', '1', {language : 'en' });
	  google.setOnLoadCallback(function() {
	    var customSearchControl = new google.search.CustomSearchControl('012476843541036121001:gx3sqkoaxkm');
	    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
	    var options = new google.search.DrawOptions();
	    options.enableSearchboxOnly("http://www.google.com/cse?cx=012476843541036121001:gx3sqkoaxkm");
	    customSearchControl.draw('cse-search-form', options);
	  }, true);
	</script>

  </body>
</html>