/usr/share/doc/renpy/html/other.html is in renpy-doc 6.17.6-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Other Functions — Ren'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'Py Documentation" href="index.html" />
<link rel="next" title="Building Distributions" href="build.html" />
<link rel="prev" title="File Access" href="file_python.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="build.html" title="Building Distributions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="file_python.html" title="File Access"
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'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="#">Other Functions</a><ul>
<li><a class="reference internal" href="#renpy-random">renpy.random</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="file_python.html"
title="previous chapter">File Access</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="build.html"
title="next chapter">Building Distributions</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="other-functions">
<h1>Other Functions<a class="headerlink" href="#other-functions" title="Permalink to this headline">¶</a></h1>
<p>We're in the process of migrating the documentation over to a new
tool. As not every page has been migrated yet, this exists to document
new functionality that has no other place to go.</p>
<dl class="function">
<dt id="renpy.call_stack_depth">
<tt class="descclassname">renpy.</tt><tt class="descname">call_stack_depth</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.call_stack_depth" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the depth of the call stack of the current context - the number
of calls that have run without being returned from or popped from the
call stack.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.choice_for_skipping">
<tt class="descclassname">renpy.</tt><tt class="descname">choice_for_skipping</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.choice_for_skipping" title="Permalink to this definition">¶</a></dt>
<dd><p>Tells Ren'Py that a choice is coming up soon. This currently has
two effects:</p>
<ul class="simple">
<li>If Ren'Py is skipping, and the Skip After Choices preferences is set
to stop skipping, skipping is terminated.</li>
<li>An auto-save is triggered.</li>
</ul>
</dd></dl>
<dl class="function">
<dt id="renpy.clear_game_runtime">
<tt class="descclassname">renpy.</tt><tt class="descname">clear_game_runtime</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.clear_game_runtime" title="Permalink to this definition">¶</a></dt>
<dd><p>Resets the game runtime counter.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.clear_keymap_cache">
<tt class="descclassname">renpy.</tt><tt class="descname">clear_keymap_cache</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.clear_keymap_cache" title="Permalink to this definition">¶</a></dt>
<dd><p>Clears the keymap cache. This allows changes to <a class="reference internal" href="config.html#var-config.keymap"><tt class="xref std std-var docutils literal"><span class="pre">config.keymap</span></tt></a> to
take effect without restarting Ren'Py.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.context_dynamic">
<tt class="descclassname">renpy.</tt><tt class="descname">context_dynamic</tt><big>(</big><em>*vars</em><big>)</big><a class="headerlink" href="#renpy.context_dynamic" title="Permalink to this definition">¶</a></dt>
<dd><p>This can be given one or more variable names as arguments. This makes
the variables dynamically scoped to the current context. The variables will
be reset to their original value when the call returns.</p>
<p>An example call is:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">$</span> <span class="n">renpy</span><span class="o">.</span><span class="n">context_dynamic</span><span class="p">(</span><span class="s">"x"</span><span class="p">,</span> <span class="s">"y"</span><span class="p">,</span> <span class="s">"z"</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="renpy.dynamic">
<tt class="descclassname">renpy.</tt><tt class="descname">dynamic</tt><big>(</big><em>*vars</em><big>)</big><a class="headerlink" href="#renpy.dynamic" title="Permalink to this definition">¶</a></dt>
<dd><p>This can be given one or more variable names as arguments. This makes
the variables dynamically scoped to the current call. The variables will
be reset to their original value when the call returns.</p>
<p>An example call is:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">$</span> <span class="n">renpy</span><span class="o">.</span><span class="n">dynamic</span><span class="p">(</span><span class="s">"x"</span><span class="p">,</span> <span class="s">"y"</span><span class="p">,</span> <span class="s">"z"</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="renpy.focus_coordinates">
<tt class="descclassname">renpy.</tt><tt class="descname">focus_coordinates</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.focus_coordinates" title="Permalink to this definition">¶</a></dt>
<dd><p>This attempts to find the coordinates of the currently-focused
displayable. If it can, it will return them as a (x, y, w, h)
tuple. If not, it will return a (None, None, None, None) tuple.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.force_full_redraw">
<tt class="descclassname">renpy.</tt><tt class="descname">force_full_redraw</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.force_full_redraw" title="Permalink to this definition">¶</a></dt>
<dd><p>Forces the screen to be redrawn in full. Call this after using pygame
to redraw the screen directly.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.free_memory">
<tt class="descclassname">renpy.</tt><tt class="descname">free_memory</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.free_memory" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempts to free some memory. Useful before running a renpygame-based
minigame.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.full_restart">
<tt class="descclassname">renpy.</tt><tt class="descname">full_restart</tt><big>(</big><em>transition=False</em>, <em>label='_invoke_main_menu'</em>, <em>target='_main_menu'</em><big>)</big><a class="headerlink" href="#renpy.full_restart" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes Ren'Py to restart, returning the user to the main menu.</p>
<dl class="docutils">
<dt><cite>transition</cite></dt>
<dd>If given, the transition to run, or None to not run a transition.
False uses <a class="reference internal" href="config.html#var-config.end_game_transition"><tt class="xref std std-var docutils literal"><span class="pre">config.end_game_transition</span></tt></a>.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.get_autoreload">
<tt class="descclassname">renpy.</tt><tt class="descname">get_autoreload</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_autoreload" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the autoreload flag.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_game_runtime">
<tt class="descclassname">renpy.</tt><tt class="descname">get_game_runtime</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_game_runtime" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the game runtime counter.</p>
<p>The game runtime counter counts the number of seconds that have
elapsed while waiting for user input in the top-level context.
(It does not count time spent in the main or game menus.)</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_image_load_log">
<tt class="descclassname">renpy.</tt><tt class="descname">get_image_load_log</tt><big>(</big><em>age=None</em><big>)</big><a class="headerlink" href="#renpy.get_image_load_log" title="Permalink to this definition">¶</a></dt>
<dd><p>A generator that yields a log of image loading activity. For the last 100
image loads, this returns:</p>
<ul class="simple">
<li>The time the image was loaded (in seconds since the epoch).</li>
<li>The filename of the image that was loaded.</li>
<li>A boolean that is true if the image was preloaded, and false if the
game stalled to load it.</li>
</ul>
<p>The entries are ordered from newest to oldest.</p>
<dl class="docutils">
<dt><cite>age</cite></dt>
<dd>If not None, only images that have been loaded in the past <cite>age</cite>
seconds are included.</dd>
</dl>
<p>The image load log is only kept if config.developer = True.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_mouse_pos">
<tt class="descclassname">renpy.</tt><tt class="descname">get_mouse_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_mouse_pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an (x, y) tuple giving the location of the mouse pointer or the
current touch location. If the device does not support a mouse and is not
currently being touched, x and y are numbers, but not meaningful.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_physical_size">
<tt class="descclassname">renpy.</tt><tt class="descname">get_physical_size</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_physical_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the size of the physical window.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_renderer_info">
<tt class="descclassname">renpy.</tt><tt class="descname">get_renderer_info</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_renderer_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary, giving information about the renderer Ren'Py is
currently using. The dictionary has one required key:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">"renderer"</span></tt></dt>
<dd>One of <tt class="docutils literal"><span class="pre">"gl"</span></tt> or <tt class="docutils literal"><span class="pre">"sw"</span></tt>, corresponding to the OpenGL and
software renderers, respectively.</dd>
<dt><tt class="docutils literal"><span class="pre">"resizable"</span></tt></dt>
<dd>True if and only if the window is resizable.</dd>
<dt><tt class="docutils literal"><span class="pre">"additive"</span></tt></dt>
<dd>True if and only if the renderer supports additive blending.</dd>
</dl>
<p>Other, renderer-specific, keys may also exist. The dictionary should
be treated as immutable. This should only be called once the display
has been started (that is, after the init code is finished).</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_say_attributes">
<tt class="descclassname">renpy.</tt><tt class="descname">get_say_attributes</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.get_say_attributes" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the attributes associated with the current say statement, or
None if no attributes are associated with this statement.</p>
<p>This is only valid when executing or predicting a say statement.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_side_image">
<tt class="descclassname">renpy.</tt><tt class="descname">get_side_image</tt><big>(</big><em>prefix_tag</em>, <em>image_tag=None</em>, <em>not_showing=True</em>, <em>layer='master'</em><big>)</big><a class="headerlink" href="#renpy.get_side_image" title="Permalink to this definition">¶</a></dt>
<dd><p>This attempts to find an image to show as the side image.</p>
<p>It begins by determining a set of image attributes. If <cite>image_tag</cite> is
given, it gets the image attributes from the tag. Otherwise, it gets
them from the currently showing character.</p>
<p>It then looks up an image with the tag <cite>prefix_tag</cite> and those attributes,
and returns it if it exists.</p>
<p>If not_showing is True, this only returns a side image if the image the
attributes are taken from is not on the screen.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.get_transition">
<tt class="descclassname">renpy.</tt><tt class="descname">get_transition</tt><big>(</big><em>layer=None</em><big>)</big><a class="headerlink" href="#renpy.get_transition" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the transition for <cite>layer</cite>, or the entire scene if
<cite>layer</cite> is None. This returns the transition that is queued up
to run during the next interaction, or None if no such
transition exists.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.iconify">
<tt class="descclassname">renpy.</tt><tt class="descname">iconify</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.iconify" title="Permalink to this definition">¶</a></dt>
<dd><p>Iconifies the game.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.is_seen">
<tt class="descclassname">renpy.</tt><tt class="descname">is_seen</tt><big>(</big><em>ever=True</em><big>)</big><a class="headerlink" href="#renpy.is_seen" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if the current line has been seen by the player.</p>
<p>If <cite>ever</cite> is true, we check to see if the line has ever been seen by the
player. If false, we check if the line has been seen in the current
play-through.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.load_module">
<tt class="descclassname">renpy.</tt><tt class="descname">load_module</tt><big>(</big><em>name</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#renpy.load_module" title="Permalink to this definition">¶</a></dt>
<dd><p>This loads the Ren'Py module named name. A Ren'Py module consists of Ren'Py code
that is loaded into the usual (store) namespace, contained in a file named
name.rpym or name.rpymc. If a .rpym file exists, and is newer than the
corresponding .rpymc file, it is loaded and a new .rpymc file is created.</p>
<p>All init code in the module is run before this function returns. An error is
raised if the module name cannot be found, or is ambiguous.</p>
<p>Module loading may only occur from inside an init block.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.load_string">
<tt class="descclassname">renpy.</tt><tt class="descname">load_string</tt><big>(</big><em>s</em>, <em>filename='<string>'</em><big>)</big><a class="headerlink" href="#renpy.load_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads <cite>s</cite> as Ren'Py script that can be called.</p>
<p>Returns the name of the first statement in s.</p>
<p><cite>filename</cite> is the name of the filename that statements in the string will
appear to be from.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.notify">
<tt class="descclassname">renpy.</tt><tt class="descname">notify</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#renpy.notify" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes Ren'Py to display the <cite>message</cite> using the notify screen. By
default, this will cause the message to be dissolved in, displayed
for two seconds, and dissolved out again.</p>
<p>This is useful for actions that otherwise wouldn't produce feedback,
like screenshots or quicksaves.</p>
<p>Only one notification is displayed at a time. If a second notification
is displayed, the first notification is replaced.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.pause">
<tt class="descclassname">renpy.</tt><tt class="descname">pause</tt><big>(</big><em>delay=None</em>, <em>music=None</em>, <em>with_none=None</em>, <em>hard=False</em>, <em>checkpoint=None</em><big>)</big><a class="headerlink" href="#renpy.pause" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes Ren'Py to pause. Returns true if the user clicked to end the pause,
or false if the pause timed out or was skipped.</p>
<dl class="docutils">
<dt><cite>delay</cite></dt>
<dd>If given, the number of seconds Ren'Py should pause for.</dd>
<dt><cite>music</cite></dt>
<dd>Retained for compatibility purposes.</dd>
<dt><cite>with_none</cite></dt>
<dd>Determines if a with None clause is executed at the end of the pause.</dd>
<dt><cite>hard</cite></dt>
<dd>If true, a click will not interrupt the pause. Use this sparingly,
as it's hard to distinguish a hard pause from a crashing game.</dd>
<dt><cite>checkpoint</cite></dt>
<dd>If true, a checkpoint will be set, and players will be able to roll
back to this statement. If false, no checkpoint will be set. If None,
a checkpoint will only be set if display is set.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.pop_call">
<tt class="descclassname">renpy.</tt><tt class="descname">pop_call</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.pop_call" title="Permalink to this definition">¶</a></dt>
<dd><p>Pops the current call from the call stack, without returning to
the location.</p>
<p>This can be used if a label that is called decides not to return
to its caller.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.pop_return">
<tt class="descclassname">renpy.</tt><tt class="descname">pop_return</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.pop_return" title="Permalink to this definition">¶</a></dt>
<dd><p>Pops the current call from the call stack, without returning to
the location.</p>
<p>This can be used if a label that is called decides not to return
to its caller.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.queue_event">
<tt class="descclassname">renpy.</tt><tt class="descname">queue_event</tt><big>(</big><em>name</em>, <em>up=False</em><big>)</big><a class="headerlink" href="#renpy.queue_event" title="Permalink to this definition">¶</a></dt>
<dd><p>Queues an event with the given name. <cite>Name</cite> should be one of the event
names in <a class="reference internal" href="config.html#var-config.keymap"><tt class="xref std std-var docutils literal"><span class="pre">config.keymap</span></tt></a>.</p>
<dl class="docutils">
<dt><cite>up</cite></dt>
<dd>This should be false when the event begins (for example, when a keyboard
button is pressed.) It should be true when the event begins (when the
button is released.)</dd>
</dl>
<p>The event is queued at the time this function is called. This function will
not work to replace an event with another - doing so will change event order.
(Use <a class="reference internal" href="config.html#var-config.keymap"><tt class="xref std std-var docutils literal"><span class="pre">config.keymap</span></tt></a> instead.)</p>
<p>This method is threadsafe.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.quit">
<tt class="descclassname">renpy.</tt><tt class="descname">quit</tt><big>(</big><em>relaunch=False</em>, <em>status=0</em><big>)</big><a class="headerlink" href="#renpy.quit" title="Permalink to this definition">¶</a></dt>
<dd><p>This causes Ren'Py to exit entirely.</p>
<dl class="docutils">
<dt><cite>relaunch</cite></dt>
<dd>If true, Ren'Py will run a second copy of itself before quitting.</dd>
<dt><cite>status</cite></dt>
<dd>The status code Ren'Py will return to the operating system.
Generally, 0 is success, and positive integers are failure.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.quit_event">
<tt class="descclassname">renpy.</tt><tt class="descname">quit_event</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.quit_event" title="Permalink to this definition">¶</a></dt>
<dd><p>Triggers a quit event, as if the player clicked the quit button in the
window chrome.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.reload_script">
<tt class="descclassname">renpy.</tt><tt class="descname">reload_script</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.reload_script" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes Ren'Py to save the game, reload the script, and then load the
save.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.restart_interaction">
<tt class="descclassname">renpy.</tt><tt class="descname">restart_interaction</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.restart_interaction" title="Permalink to this definition">¶</a></dt>
<dd><p>Restarts the current interaction. Among other things, this displays
images added to the scene, re-evaluates screens, and starts any
queued transitions.</p>
<p>This only does anything when called from within an interaction (for
example, from an action). Outside an interaction, this function has
no effect.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.screenshot">
<tt class="descclassname">renpy.</tt><tt class="descname">screenshot</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#renpy.screenshot" title="Permalink to this definition">¶</a></dt>
<dd><p>Saves a screenshot in <cite>filename</cite>.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.scry">
<tt class="descclassname">renpy.</tt><tt class="descname">scry</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.scry" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the scry object for the current statement.</p>
<p>The scry object tells Ren'Py about things that must be true in the
future of the current statement. Right now, the scry object has one
field:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">nvl_clear</span></tt></dt>
<dd>Is true if an <tt class="docutils literal"><span class="pre">nvl</span> <span class="pre">clear</span></tt> statement will execute before the
next interaction.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.set_autoreload">
<tt class="descclassname">renpy.</tt><tt class="descname">set_autoreload</tt><big>(</big><em>autoreload</em><big>)</big><a class="headerlink" href="#renpy.set_autoreload" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the autoreload flag, which determines if the game will be
automatically reloaded after file changes. Autoreload will not be
fully enabled until the game is reloaded with <tt class="xref py py-func docutils literal"><span class="pre">renpy.utter_restart()</span></tt>.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.set_mouse_pos">
<tt class="descclassname">renpy.</tt><tt class="descname">set_mouse_pos</tt><big>(</big><em>x</em>, <em>y</em>, <em>duration=0</em><big>)</big><a class="headerlink" href="#renpy.set_mouse_pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Jump the mouse pointer to the location given by arguments x and y.
If the device does not have a mouse pointer, this does nothing.</p>
<dl class="docutils">
<dt><cite>duration</cite></dt>
<dd>The time it will take to perform the move, in seconds.
During this time, the mouse may be unresponsive.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.set_physical_size">
<tt class="descclassname">renpy.</tt><tt class="descname">set_physical_size</tt><big>(</big><em>size</em><big>)</big><a class="headerlink" href="#renpy.set_physical_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempts to set the size of the physical window to <cite>size</cite>. This has the
side effect of taking the screen out of fullscreen mode.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.shown_window">
<tt class="descclassname">renpy.</tt><tt class="descname">shown_window</tt><big>(</big><big>)</big><a class="headerlink" href="#renpy.shown_window" title="Permalink to this definition">¶</a></dt>
<dd><p>Call this to indicate that the window has been shown. This interacts
with the "window show" statement, which shows an empty window whenever
this functions has not been called during an interaction.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.transition">
<tt class="descclassname">renpy.</tt><tt class="descname">transition</tt><big>(</big><em>trans</em>, <em>layer=None</em>, <em>always=False</em><big>)</big><a class="headerlink" href="#renpy.transition" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the transition that will be used during the next interaction.</p>
<dl class="docutils">
<dt><cite>layer</cite></dt>
<dd>The layer the transition applies to. If None, the transition
applies to the entire scene.</dd>
<dt><cite>always</cite></dt>
<dd>If false, this respects the transition preference. If true, the
transition is always run.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="renpy.version">
<tt class="descclassname">renpy.</tt><tt class="descname">version</tt><big>(</big><em>tuple=False</em><big>)</big><a class="headerlink" href="#renpy.version" title="Permalink to this definition">¶</a></dt>
<dd><p>If <cite>tuple</cite> is false, returns a string containing "Ren'Py ", followed by
the current version of Ren'Py.</p>
<p>If <cite>tuple</cite> is true, returns a tuple giving each component of the
version as an integer.</p>
</dd></dl>
<dl class="function">
<dt id="renpy.vibrate">
<tt class="descclassname">renpy.</tt><tt class="descname">vibrate</tt><big>(</big><em>duration</em><big>)</big><a class="headerlink" href="#renpy.vibrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Causes the device to vibrate for <cite>duration</cite> seconds. Currently, this
is only supported on Android.</p>
</dd></dl>
<dl class="function">
<dt id="layout.yesno_screen">
<tt class="descclassname">layout.</tt><tt class="descname">yesno_screen</tt><big>(</big><em>message</em>, <em>yes=None</em>, <em>no=None</em><big>)</big><a class="headerlink" href="#layout.yesno_screen" title="Permalink to this definition">¶</a></dt>
<dd><p>This causes the a yes/no prompt screen with the given message
to be displayed. The screen will be hidden when the user hits
yes or no.</p>
<dl class="docutils">
<dt><cite>message</cite></dt>
<dd>The message that will be displayed.</dd>
<dt><cite>yes</cite></dt>
<dd>An action that is run when the user chooses yes.</dd>
<dt><cite>no</cite></dt>
<dd>An action that is run when the user chooses no.</dd>
</dl>
</dd></dl>
<div class="section" id="renpy-random">
<h2>renpy.random<a class="headerlink" href="#renpy-random" title="Permalink to this headline">¶</a></h2>
<p>This object is a random number generator that implements
<a class="reference external" href="http://docs.python.org/release/2.3.4/lib/module-random.html">the Python random number generation interface</a>.
Randomness can be generated by calling the various methods this object
exposes. See the Python documentation for the full list, but the most useful
are:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">renpy.random.random()</span></tt></li>
</ul>
<p>Return the next random floating point number in the range (0.0, 1.0).</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">renpy.random.randint(a,</span> <span class="pre">b)</span></tt></li>
</ul>
<p>Return a random integer such that a <= N <= b.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">renpy.random.choice(seq)</span></tt></li>
</ul>
<p>Return a random element from the non-empty sequence seq.</p>
<p>Unlike the standard Python random number generator, this object cooperates with
rollback, generating the same numbers regardless of how many times we rollback.
It should be used instead of the standard Python random module.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="c"># return a random float between 0 and 1</span>
<span class="k">$</span> <span class="n">randfloat</span> <span class="o">=</span> <span class="n">renpy</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">()</span>
<span class="c"># return a random integer between 1 and 20</span>
<span class="k">$</span> <span class="n">d20roll</span> <span class="o">=</span> <span class="n">renpy</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">20</span><span class="p">)</span>
<span class="c"># return a random element from a list</span>
<span class="k">$</span> <span class="n">randfruit</span> <span class="o">=</span> <span class="n">renpy</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="k">choice</span><span class="p">([</span><span class="s">'apple'</span><span class="p">,</span> <span class="s">'orange'</span><span class="p">,</span> <span class="s">'plum'</span><span class="p">])</span>
</pre></div>
</div>
</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="build.html" title="Building Distributions"
>next</a> |</li>
<li class="right" >
<a href="file_python.html" title="File Access"
>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'Py Documentation</a></li>
</ul>
</div>
</body>
</html>
|