Compare commits

...

23 Commits

Author SHA1 Message Date
Tom Rothamel 4967862763 Bump version. 2013-12-17 21:22:11 -05:00
Tom Rothamel fc04acb208 Update docs. 2013-12-16 22:47:56 -05:00
kyouryuukunn a9939d823d fix typo 2013-12-16 22:46:20 -05:00
Tom Rothamel 54b82d46f6 Link variables and classes in the reserved names list.
Conflicts:
	sphinx/source/inc/reserved_renpy
2013-12-16 02:26:03 -05:00
Tom Rothamel e217e96f0a Allow Ren'Py to compile with freetype 2.5.1.
Fixes #250.
2013-12-16 02:20:47 -05:00
Tom Rothamel e2fee1b9af Fix sense of environment-encoding test. 2013-12-16 01:34:40 -05:00
Tom Rothamel 9761da8585 Bump version. 2013-12-16 00:14:15 -05:00
Tom Rothamel 7c86577b5f Report NO_RAPT before NO_JDK.
On Windows, RAPT is responsible for detecting the JDK. If RAPT is
missing, the JDK will also be reported missing - even if it's
installed.

Changing the reporting order makes this less confusing.
2013-12-15 22:17:05 -05:00
Tom Rothamel 127bba619f Fix typo that broke Android.
We copied script_version.rpy onto script_version.rpyc, which
made things fail to start on Android.
2013-12-15 22:17:05 -05:00
Tom Rothamel a4673a6a38 Merge pull request #257 from LuqueDaniel/fix-rmtree
Fix delete the tmp directory
2013-12-15 22:16:45 -05:00
Tom Rothamel 51185c3628 More documentation and flagging as undocumented. 2013-12-15 22:16:02 -05:00
Tom Rothamel 3add242651 Document NoRollback as class, not function. 2013-12-15 22:16:02 -05:00
Tom Rothamel f84c2b46cf Document renpy.map_event. 2013-12-15 22:16:02 -05:00
Tom Rothamel ff7631d292 Ignore errors in OpenDirectory. 2013-12-15 22:16:02 -05:00
Tom Rothamel 74bae3eeeb Document NoRollback. 2013-12-15 22:16:02 -05:00
Tom Rothamel f94ffde48f Check in inc/disp_grid. 2013-12-15 22:15:05 -05:00
Tom Rothamel 9956d269a4 Document Grid.
Conflicts:
	sphinx/source/inc/reserved_renpy
2013-12-15 22:13:35 -05:00
Tom Rothamel 420f4351e2 Ensure that all generated documentation is included. 2013-12-15 22:12:34 -05:00
Tom Rothamel c644a64c1c Check documentation for unused includes. 2013-12-15 22:12:34 -05:00
Tom Rothamel 700fe066f5 Documentation. 2013-12-15 22:12:34 -05:00
Tom Rothamel e6b83049af Fix bug where Reply would not properly evaluate locked=None. 2013-12-07 23:57:56 -05:00
Tom Rothamel 833da0847c Change list_saved_games as well.
Thanks, zorexx.
2013-12-04 22:51:58 -05:00
Tom Rothamel 0a56acc1b6 scan_saved_game should use _save_name, not _extra_info. 2013-12-04 11:25:37 -05:00
35 changed files with 478 additions and 150 deletions
+7 -7
View File
@@ -2,8 +2,8 @@
# See LICENSE.txt for license details.
init python:
ANDROID_NO_JDK = 0
ANDROID_NO_RAPT = 1
ANDROID_NO_RAPT = 0
ANDROID_NO_JDK = 1
ANDROID_NO_SDK = 2
ANDROID_NO_KEY = 3
ANDROID_NO_CONFIG = 4
@@ -80,10 +80,10 @@ init python:
Determines the state of the android install, and returns it.
"""
if renpy.windows and not "JAVA_HOME" in os.environ:
return ANDROID_NO_JDK
if RAPT_PATH is None:
return ANDROID_NO_RAPT
if renpy.windows and not "JAVA_HOME" in os.environ:
return ANDROID_NO_JDK
if not os.path.exists(os.path.join(RAPT_PATH, "android-sdk/extras/google/play_licensing")):
return ANDROID_NO_SDK
if not os.path.exists(os.path.join(RAPT_PATH, "android.keystore")):
@@ -98,10 +98,10 @@ init python:
Returns text corresponding to the state.
"""
if state == ANDROID_NO_JDK:
return NO_JDK_TEXT
if state == ANDROID_NO_RAPT:
return NO_RAPT_TEXT
if state == ANDROID_NO_JDK:
return NO_JDK_TEXT
if state == ANDROID_NO_SDK:
return NO_SDK_TEXT
if state == ANDROID_NO_KEY:
@@ -335,7 +335,7 @@ init python:
# The android support can stick unicode into os.environ. Fix that.
init 100 python:
for k, v in list(os.environ.items()):
if isinstance(v, str):
if not isinstance(v, str):
os.environ[k] = renpy.fsencode(v)
screen android_process(interface):
+1 -1
View File
@@ -559,7 +559,7 @@ init python in distribute:
"""
SCRIPT_VERSION_RPY = os.path.join(config.gamedir, "script_version.rpy")
SCRIPT_VERSION_RPYC = os.path.join(config.gamedir, "script_version.rpy")
SCRIPT_VERSION_RPYC = os.path.join(config.gamedir, "script_version.rpyc")
LICENSE_TXT = os.path.join(config.renpy_base, "LICENSE.txt")
if os.path.exists(SCRIPT_VERSION_RPY):
+11 -7
View File
@@ -25,14 +25,18 @@ init python:
def __call__(self):
directory = renpy.fsencode(self.directory)
try:
directory = renpy.fsencode(self.directory)
if renpy.windows:
os.startfile(directory)
elif renpy.macintosh:
subprocess.Popen([ "open", directory ])
else:
subprocess.Popen([ "xdg-open", directory ])
if renpy.windows:
os.startfile(directory)
elif renpy.macintosh:
subprocess.Popen([ "open", directory ])
else:
subprocess.Popen([ "xdg-open", directory ])
except:
pass
# Used for testing.
def Relaunch():
+1 -1
View File
@@ -81,7 +81,7 @@ label new_project:
# Delete the tmp directory, if it exists.
if os.path.isdir(os.path.join(project_dir, "tmp")):
os.path.rmtree(os.path.join(project_dir, "tmp"))
shutil.rmtree(os.path.join(project_dir, "tmp"))
# Delete project.json, which must exist.
os.unlink(os.path.join(project_dir, "project.json"))
+1 -1
View File
@@ -25,7 +25,7 @@ include("zlib.h")
include("png.h")
include("SDL.h", directory="SDL")
include("ft2build.h")
include("freetype/freetype.h", directory="freetype2")
include("freetype/freetype.h", directory="freetype2", optional=True) or include("freetype.h", directory="freetype2")
include("libavutil/avstring.h")
include("libavformat/avformat.h")
include("libavcodec/avcodec.h")
+2 -2
View File
@@ -3,7 +3,7 @@
#include <stdint.h>
#include <ft2build.h>
#include <freetype/ftotval.h>
#include FT_OPENTYPE_VALIDATE_H
typedef struct
{
@@ -101,7 +101,7 @@ typedef struct
typedef struct
{
int LookupCount;
TLookup *Lookup;
TLookup *Lookup;
} TLookupList;
typedef struct
+1 -1
View File
@@ -35,7 +35,7 @@ except ImportError:
# we bump the version.
#
# Be sure to change config.version in tutorial/game/options.rpy.
version_tuple = (6, 16, 3, vc_version)
version_tuple = (6, 16, 5, vc_version)
# A verbose string computed from that version.
version = "Ren'Py " + ".".join(str(i) for i in version_tuple)
+4 -5
View File
@@ -271,10 +271,6 @@ init -1500 python:
def __init__(self, label, scope={}, locked=None):
self.label = label
self.scope = scope
if locked is None:
self.locked = not renpy.seen_label(label)
self.locked = locked
def __call__(self):
@@ -291,7 +287,10 @@ init -1500 python:
renpy.transition(config.exit_replay_transition)
def get_sensitive(self):
return not self.locked
if self.locked is not None:
return self.locked
return renpy.seen_label(self.label)
class EndReplay(Action):
"""
+12 -9
View File
@@ -185,7 +185,7 @@ absolute = renpy.display.core.absolute
NoRollback = renpy.python.NoRollback
def layout(cls, doc, nargs=0, **extra_kwargs):
def _layout(cls, doc, nargs=0, **extra_kwargs):
def f(*args, **properties):
@@ -205,7 +205,7 @@ def layout(cls, doc, nargs=0, **extra_kwargs):
return f
Fixed = layout(renpy.display.layout.MultiBox, """
Fixed = _layout(renpy.display.layout.MultiBox, """
:doc: disp_box
:args: (*args, **properties)
@@ -214,24 +214,30 @@ from back to front, with their position properties
controlling their position.
""", layout="fixed")
HBox = layout(renpy.display.layout.MultiBox, """
HBox = _layout(renpy.display.layout.MultiBox, """
:doc: disp_box
:args: (*args, **properties)
A box that lays out its members from left to right.
""", layout='horizontal')
VBox = layout(renpy.display.layout.MultiBox, """
VBox = _layout(renpy.display.layout.MultiBox, """
:doc: disp_box
:args: (*args, **properties)
A layout that lays out its members from top to bottom.
""", layout='vertical')
Grid = layout(renpy.display.layout.Grid, """
A layout that lays out displayables in a grid.
Grid = _layout(renpy.display.layout.Grid, """
:doc: disp_grid
Lays out displayables in a a grid. The first two positional arguments
are the number of columns and rows in the grid. This must be followed
by `columns * rows` positional arguments giving the displayables that
fill the grid.
""", nargs=2, layout='vertical')
del _layout
def AlphaBlend(control, old, new, alpha=False):
"""
@@ -249,9 +255,6 @@ def AlphaBlend(control, old, new, alpha=False):
return renpy.display.transition.AlphaDissolve(control, 0.0, old_widget=old, new_widget=new, alpha=alpha)
del layout
def At(d, *args):
"""
:doc: disp_at
+16 -5
View File
@@ -125,13 +125,24 @@ def compile_event(key, keydown):
event_cache = { }
keyup_cache = { }
def map_event(ev, name):
"""Returns true if the event matches the named keycode being pressed."""
def map_event(ev, keysym):
"""
:doc: udd_utility
check_code = event_cache.get(name, None)
Returns true if the pygame event `ev` matches `keysym`
`keysym`
One of:
* The name of a keybinding in :var:`config.keymap`.
* A keysym, as documented in the :ref:`keymap` section.
* A list containing one or more keysyms.
"""
check_code = event_cache.get(keysym, None)
if check_code is None:
check_code = eval("lambda ev : " + compile_event(name, True), globals())
event_cache[name] = check_code
check_code = eval("lambda ev : " + compile_event(keysym, True), globals())
event_cache[keysym] = check_code
return check_code(ev)
+1 -1
View File
@@ -236,7 +236,7 @@ class SpriteManager(renpy.display.core.Displayable):
def redraw(self, delay=0):
"""
:doc: sprite method
:doc: sprites method
Causes this SpriteManager to be redrawn in `delay` seconds.
"""
+126 -13
View File
@@ -35,6 +35,7 @@ from renpy.text.font import register_sfont, register_mudgefont, register_bmfont
from renpy.text.text import language_tailor
from renpy.display.behavior import Keymap
from renpy.display.behavior import run as run_action, run_unhovered, run_periodic
from renpy.display.behavior import map_event
from renpy.display.minigame import Minigame
from renpy.display.screen import define_screen, show_screen, hide_screen, use_screen, current_screen, has_screen, get_screen, get_widget
@@ -70,13 +71,15 @@ import sys
def public_api():
"""
:undocumented:
This does nothing, except to make the pyflakes warnings about
unused imports go away.
"""
ParameterizedText
register_sfont, register_mudgefont, register_bmfont
Keymap
run_action, run_unhovered, run_periodic
run_action, run_unhovered, run_periodic, map_event
Minigame
curry, partial
play
@@ -226,6 +229,28 @@ def image(name, d):
renpy.display.image.register_image(name, d)
def copy_images(old, new):
"""
:doc: image_func
Copies images beginning with one prefix to images beginning with
another. For example::
renpy.copy_images("eileen", "eileen2")
will create an image beginning with "eileen2" for every image beginning
with "eileen". If "eileen happy" exists, "eileen2 happy" will be
created.
`old`
A space-separated string giving the components of the old image
name.
`new`
A space-separated string giving the components of the new image
name.
"""
if not isinstance(old, tuple):
old = tuple(old.split())
@@ -576,6 +601,8 @@ def choice_for_skipping():
def predict_menu():
"""
:undocumented:
Predicts widgets that are used by the menu.
"""
@@ -628,7 +655,6 @@ def display_menu(items,
`screen`
The name of the screen used to display the menu.
In each pair the first element of which is a textual label, and the second item
"""
if interact:
@@ -759,6 +785,8 @@ tag_quoting_dict = TagQuotingDict()
def predict_say(who, what):
"""
:undocumented:
This is called to predict the results of a say command.
"""
@@ -774,6 +802,8 @@ def predict_say(who, what):
def scry_say(who, scry):
"""
:undocumented:
Called when scry is called on a say statement. Needs to set
the interacts field.
"""
@@ -785,9 +815,29 @@ def scry_say(who, scry):
def say(who, what, interact=True):
"""
This is the core of the say command. If the who parameter is None
or a string, it is passed directly to display_say. Otherwise, the
say method is called on the who object with what as a parameter.
:doc: se_say
The equivalent of the say statement.
`who`
Either the character that will say something, None for the narrator,
or a string giving the character name. In the latter case, the
:func:`say` is used to create the speaking character.
`what`
A string giving the line to say. Percent-substitutions are performed
in this string.
`interact`
If true, Ren'Py waits for player input when displaying the dialogue. If
false, Ren'Py shows the dialogue, but does not perform an interaction.
This function is rarely necessary, as the following three lines are
equivalent. ::
e "Hello, world."
$ renpy.say(e, "Hello, world.")
$ e("Hello, world.")
"""
if renpy.config.old_substitutions:
@@ -806,6 +856,8 @@ def say(who, what, interact=True):
def imagemap(ground, selected, hotspots, unselected=None, overlays=False,
style='imagemap', mouse='imagemap', with_none=None, **properties):
"""
:undocumented: Use screens already.
Displays an imagemap. An image map consists of two images and a
list of hotspots that are defined on that image. When the user
clicks on a hotspot, the value associated with that hotspot is
@@ -1072,6 +1124,7 @@ def rollback(force=False, checkpoints=1, defer=False, greedy=True, label=None):
def toggle_fullscreen():
"""
:undocumented:
Toggles the fullscreen mode.
"""
@@ -1079,6 +1132,7 @@ def toggle_fullscreen():
def toggle_music():
"""
:undocumented:
Toggles the playing of music.
"""
@@ -1141,6 +1195,8 @@ def full_restart(transition=False, label="_invoke_main_menu", target="_main_menu
def utter_restart():
"""
:undocumented: Used in the implementation of shift+R.
Causes an utter restart of Ren'Py. This reloads the script and
re-runs initialization.
"""
@@ -1206,7 +1262,7 @@ def version(tuple=False): #@ReservedAssignment
If `tuple` is false, returns a string containing "Ren'Py ", followed by
the current version of Ren'Py.
If `tuple` is true, returns a string giving each component of the
If `tuple` is true, returns a tuple giving each component of the
version as an integer.
"""
@@ -1217,6 +1273,7 @@ def version(tuple=False): #@ReservedAssignment
def module_version():
"""
:undocumented:
Returns a number corresponding to the current version of the Ren'Py module,
or 0 if the module wasn't loaded.
"""
@@ -1245,6 +1302,15 @@ def transition(trans, layer=None, always=False, force=False):
renpy.game.interface.set_transition(trans, layer, force=force)
def get_transition(layer=None):
"""
:doc: other
Gets the transition for `layer`, or the entire scene if
`layer` is None. This returns the transition that is queued up
to run during the next interaction, or None if no such
transition exists.
"""
return renpy.game.interface.transition.get(layer, None)
def clear_game_runtime():
@@ -1300,12 +1366,15 @@ def exists(filename):
def restart_interaction():
"""
Calling this restarts the current interaction. This will immediately end
any ongoing transition, and will call all of the overlay functions again.
:doc: other
This should be called whenever widgets are added or removed over the course
of an interaction, or when the information used to construct the overlay
changes.
Restarts the current interaction. Among other things, this displays
images added to the scene, re-evaluates screens, and starts any
queued transitions.
This only does anything when called from within an interaction (for
example, from an action). Outside an interaction, this function has
no effect.
"""
try:
@@ -1427,9 +1496,33 @@ def last_interact_type():
return getattr(renpy.game.context().info, "_last_interact_type", None)
def dynamic(*vars): #@ReservedAssignment
"""
:doc: other
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.
An example call is::
$ renpy.dynamic("x", "y", "z")
"""
renpy.game.context().make_dynamic(vars)
def context_dynamic(*vars): #@ReservedAssignment
"""
:doc: other
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.
An example call is::
$ renpy.context_dynamic("x", "y", "z")
"""
renpy.game.context().make_dynamic(vars, context=True)
def seen_label(label):
@@ -1695,12 +1788,25 @@ def call_stack_depth():
def game_menu(screen=None):
"""
:undocumented: Probably not what we want in the presence of
screens.
"""
if screen is None:
call_in_new_context("_game_menu")
else:
call_in_new_context("_game_menu", screen)
def shown_window():
"""
:doc: other
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.
"""
renpy.game.context().scene_lists.shown_window = True
class placement(renpy.python.RevertableObject):
@@ -1755,6 +1861,9 @@ def get_roll_forward():
return renpy.game.interface.shown_window
def cache_pin(*args):
"""
:undocumented: Cache pin is deprecated.
"""
new_pins = renpy.python.RevertableSet()
@@ -1771,6 +1880,9 @@ def cache_pin(*args):
def cache_unpin(*args):
"""
:undocumented: Cache pin is deprecated.
"""
new_pins = renpy.python.RevertableSet()
@@ -1875,8 +1987,9 @@ def get_renderer_info():
def display_reset():
"""
Used internally. Causes the display to be restarted at the start of
the next interaction.
:undocumented: Used internally.
Causes the display to be restarted at the start of the next interaction.
"""
renpy.display.interface.display_reset = True
+2 -2
View File
@@ -395,7 +395,7 @@ def scan_saved_game(slotname):
if json is None:
return None
extra_info = json.get("_extra_info", "")
extra_info = json.get("_save_name", "")
screenshot = c.get_screenshot()
@@ -443,7 +443,7 @@ def list_saved_games(regexp=r'.', fast=False):
c = get_cache(s)
extra_info = c.get_json().get("_extra_info", "")
extra_info = c.get_json().get("_save_name", "")
screenshot = c.get_screenshot()
mtime = c.get_mtime()
+1 -1
View File
@@ -44,7 +44,7 @@ from renpy.translation import translate_string as __ # @UnusedImport
def _(s):
"""
:doc: translate
:undocumented: Documented directly in the .rst.
Flags a string as translatable, and returns it immediately. The string
will be translated when text displays it.
+5 -1
View File
@@ -226,7 +226,11 @@ def clean_stores():
class NoRollback(object):
"""
Objects inheriting from this object do not participate in Rollback.
:doc: norollback class
Instances of classes inheriting from this class do not participate in
rollback. Objects reachable through an instance of a NoRollback class
only participate in rollback if they are reachable through other paths.
"""
pass
+1 -1
View File
@@ -7,5 +7,5 @@ cd $SPHINX
sphinx-build -a source ../doc || exit 1
echo Not uploading.
python checks.py
+36
View File
@@ -0,0 +1,36 @@
from __future__ import print_function
import os
import re
def check_include():
used = set()
def scan_file(fn):
f = open(fn)
for l in f:
m = re.search(r"\.\. include::(.+)", l)
if not m:
continue
fn = m.group(1).strip()
used.add(fn)
for i in os.listdir("source"):
if i.endswith(".rst"):
scan_file(os.path.join("source", i))
for i in os.listdir("source/inc"):
scan_file(os.path.join("source", "inc", i))
for i in os.listdir("source/inc"):
fn = "inc/" + i
if fn not in used:
print("WARNING: source/{} is not used.".format(fn))
if __name__ == "__main__":
check_include()
+36 -5
View File
@@ -251,6 +251,36 @@ def write_line_buffer():
with open("source/inc/" + k, "w") as f:
f.write(s)
name_kind = collections.defaultdict(str)
def scan_docs():
"""
Scans the documentation for functions, classes, and variables.
"""
def scan_file(fn):
f = open(fn)
for l in f:
m = re.search(r"\.\. (\w+):: ([.\w+]+)", l)
if not m:
continue
name_kind[m.group(2)] = m.group(1)
for i in os.listdir("source"):
if i.endswith(".rst"):
scan_file(os.path.join("source", i))
for i in os.listdir("source/inc"):
scan_file(os.path.join("source", "inc", i))
def write_reserved(module, dest, ignore_builtins):
print "Writing", dest
@@ -268,10 +298,11 @@ def write_reserved(module, dest, ignore_builtins):
if ignore_builtins and hasattr(__builtin__, i):
continue
o = getattr(module, i)
doc = inspect.getdoc(o)
if doc and ":doc:" in doc and not isinstance(o, renpy.curry.Curry):
i = ":func:`" + i + "`"
if name_kind[i] == 'function':
i = ":func:`{}`".format(i)
elif name_kind[i] == 'class':
i = ":class:`{}`".format(i)
elif name_kind[i] == 'var':
i = ":var:`{}`".format(i)
f.write("* " + i + "\n")
+1
View File
@@ -17,6 +17,7 @@ init 1000000 python:
doc.write_line_buffer()
doc.write_keywords()
doc.scan_docs()
doc.write_reserved(__builtin__, "source/inc/reserved_builtins", False)
doc.write_reserved(store, "source/inc/reserved_renpy", True)
+9 -3
View File
@@ -110,8 +110,8 @@ more :ref:`transforms <transforms>`.
.. include:: inc/disp_at
Layout Boxes
------------
Layout Boxes and Grids
----------------------
Layout boxes are displayables that lay out their children on the
screen. They can lay out the children in a horizontal or vertical
@@ -124,7 +124,6 @@ that are applied to the box.
Boxes take :ref:`position-style-properties` and :ref:`box-style-properties`.
.. include:: inc/disp_box
::
@@ -142,6 +141,13 @@ Boxes take :ref:`position-style-properties` and :ref:`box-style-properties`.
Image("logo.png", xalign=0.0, yalign=0.0),
Image("logo.png", xalign=1.0, yalign=1.0))
The Grid layout displays its children in a grid on the screen. It takes
:ref:`position-style-properties` and the :propref:`spacing` style
property.
.. include:: inc/disp_grid
Effects
-------
+4
View File
@@ -405,3 +405,7 @@ having the narrator say an empty string.::
window hide dissolve
Image Functions
===============
.. include:: inc/image_func
+9
View File
@@ -0,0 +1,9 @@
.. Automatically generated file - do not modify.
.. function:: Grid(*args, **properties)
Lays out displayables in a a grid. The first two positional arguments
are the number of columns and rows in the grid. This must be followed
by `columns * rows` positional arguments giving the displayables that
fill the grid.
+19
View File
@@ -1,5 +1,24 @@
.. Automatically generated file - do not modify.
.. function:: renpy.copy_images(old, new)
Copies images beginning with one prefix to images beginning with
another. For example::
renpy.copy_images("eileen", "eileen2")
will create an image beginning with "eileen2" for every image beginning
with "eileen". If "eileen happy" exists, "eileen2 happy" will be
created.
`old`
A space-separated string giving the components of the old image
name.
`new`
A space-separated string giving the components of the new image
name.
.. function:: renpy.get_placement(d)
This gets the placement of displayable d. There's very little warranty on this
-6
View File
@@ -1,6 +0,0 @@
.. Automatically generated file - do not modify.
.. function:: renpy.mode(mode)
Causes Ren'Py to enter the named mode.
+8
View File
@@ -0,0 +1,8 @@
.. Automatically generated file - do not modify.
.. class:: NoRollback()
Instances of classes inheriting from this class do not participate in
rollback. Objects reachable through an instance of a NoRollback class
only participate in rollback if they are reachable through other paths.
+44 -1
View File
@@ -14,6 +14,26 @@
Resets the game runtime counter.
.. function:: renpy.context_dynamic(*vars)
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.
An example call is::
$ renpy.context_dynamic("x", "y", "z")
.. function:: renpy.dynamic(*vars)
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.
An example call is::
$ renpy.dynamic("x", "y", "z")
.. function:: renpy.focus_coordinates()
This attempts to find the coordinates of the currently-focused
@@ -109,6 +129,13 @@
If not_showing is True, this only returns a side image if the image the
attributes are taken from is not on the screen.
.. function:: renpy.get_transition(layer=None)
Gets the transition for `layer`, or the entire scene if
`layer` is None. This returns the transition that is queued up
to run during the next interaction, or None if no such
transition exists.
.. function:: renpy.is_seen(ever=True)
Returns true if the current line has been seen by the player.
@@ -169,6 +196,16 @@
`relaunch`
If true, Ren'Py will run a second copy of itself before quitting.
.. function:: renpy.restart_interaction()
Restarts the current interaction. Among other things, this displays
images added to the scene, re-evaluates screens, and starts any
queued transitions.
This only does anything when called from within an interaction (for
example, from an action). Outside an interaction, this function has
no effect.
.. function:: renpy.screenshot(filename)
Saves a screenshot in `filename`.
@@ -178,6 +215,12 @@
Attempts to set the size of the physical window to `size`. This has the
side effect of taking the screen out of fullscreen mode.
.. function:: renpy.shown_window()
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.
.. function:: renpy.transition(trans, layer=None, always=False)
Sets the transition that will be used during the next interaction.
@@ -195,7 +238,7 @@
If `tuple` is false, returns a string containing "Ren'Py ", followed by
the current version of Ren'Py.
If `tuple` is true, returns a string giving each component of the
If `tuple` is true, returns a tuple giving each component of the
version as an integer.
.. function:: renpy.vibrate(duration)
+55 -55
View File
@@ -3,25 +3,25 @@
* Action
* Alpha
* :func:`AlphaBlend`
* AlphaDissolve
* :func:`AlphaDissolve`
* :func:`AnimatedValue`
* Animation
* :func:`At`
* Bar
* BarValue
* :class:`BarValue`
* Button
* :func:`Character`
* ComposeTransition
* :func:`ComposeTransition`
* :func:`ConditionSwitch`
* CropMove
* Dissolve
* :func:`Drag`
* :func:`DragGroup`
* :func:`CropMove`
* :func:`Dissolve`
* :class:`Drag`
* :class:`DragGroup`
* DynamicCharacter
* :func:`DynamicDisplayable`
* :func:`EndReplay`
* FactorZoom
* Fade
* :func:`Fade`
* :func:`FieldValue`
* :func:`FileAction`
* :func:`FileCurrentPage`
@@ -45,15 +45,15 @@
* :func:`Flatten`
* :func:`FontGroup`
* :func:`Frame`
* :func:`Gallery`
* Grid
* :class:`Gallery`
* :func:`Grid`
* :func:`HBox`
* :func:`Help`
* :func:`Hide`
* HideInterface
* :func:`If`
* :func:`Image`
* ImageDissolve
* :func:`ImageDissolve`
* ImageReference
* Input
* :func:`InvertSelected`
@@ -69,14 +69,14 @@
* MoveFactory
* MoveIn
* MoveOut
* MoveTransition
* :func:`MoveTransition`
* :func:`Movie`
* MultiPersistent
* MultipleTransition
* :func:`MusicRoom`
* :class:`MultiPersistent`
* :func:`MultipleTransition`
* :class:`MusicRoom`
* NVLCharacter
* NVLSpeaker
* NoRollback
* :class:`NoRollback`
* :func:`Notify`
* :func:`Null`
* :func:`NullAction`
@@ -85,9 +85,9 @@
* Pan
* ParameterizedText
* Particles
* Pause
* Pixellate
* :func:`Play`
* :func:`Pause`
* :func:`Pixellate`
* Play
* Position
* :func:`Preference`
* :func:`Queue`
@@ -120,14 +120,14 @@
* :func:`Skip`
* :func:`SnowBlossom`
* :func:`Solid`
* :func:`Speaker`
* Speaker
* SplineMotion
* :func:`Sprite`
* :func:`SpriteManager`
* :class:`Sprite`
* :class:`SpriteManager`
* :func:`Start`
* :func:`StaticValue`
* :func:`Stop`
* Style
* Stop
* :class:`Style`
* :func:`StylePreference`
* SubTransition
* :func:`Text`
@@ -136,8 +136,8 @@
* :func:`ToggleScreenVariable`
* :func:`ToggleVariable`
* :func:`ToggleVoiceMute`
* :func:`Tooltip`
* Transform
* :class:`Tooltip`
* :class:`Transform`
* :func:`VBox`
* :func:`VariableValue`
* Viewport
@@ -151,17 +151,17 @@
* absolute
* adv
* anim
* blinds
* :var:`blinds`
* build
* center
* :var:`center`
* centered
* color
* config
* default
* :var:`default`
* default_transition
* define
* dissolve
* ease
* :var:`dissolve`
* :var:`ease`
* easeinbottom
* easeinleft
* easeinright
@@ -171,27 +171,27 @@
* easeoutright
* easeouttop
* extend
* fade
* hpunch
* :var:`fade`
* :var:`hpunch`
* hyperlink_function
* hyperlink_styler
* im
* irisin
* :var:`irisin`
* irisout
* layout
* left
* :var:`left`
* library
* main_menu
* :func:`menu`
* mouse_visible
* move
* :var:`move`
* moveinbottom
* moveinleft
* moveinright
* :var:`moveinright`
* moveintop
* moveoutbottom
* moveoutleft
* moveoutright
* :var:`moveoutright`
* moveouttop
* name_only
* narrator
@@ -206,10 +206,10 @@
* nvl_show_core
* nvl_variant
* nvl_window
* offscreenleft
* offscreenright
* :var:`offscreenleft`
* :var:`offscreenright`
* persistent
* pixellate
* :var:`pixellate`
* predict
* predict_menu
* predict_say
@@ -218,20 +218,20 @@
* python_object
* python_set
* renpy
* reset
* right
* save_name
* :var:`reset`
* :var:`right`
* :var:`save_name`
* say
* skip_indicator
* slideawaydown
* slideawayleft
* :var:`slideawayleft`
* slideawayright
* slideawayup
* slidedown
* slideleft
* :var:`slideleft`
* slideright
* slideup
* squares
* :var:`squares`
* store
* style
* suppress_overlay
@@ -239,9 +239,9 @@
* theme
* toggle_skipping
* top
* topleft
* topright
* truecenter
* :var:`topleft`
* :var:`topright`
* :var:`truecenter`
* ui
* updater
* vcentered
@@ -249,11 +249,11 @@
* :func:`voice_can_replay`
* :func:`voice_replay`
* :func:`voice_sustain`
* vpunch
* :var:`vpunch`
* wipedown
* wipeleft
* :var:`wipeleft`
* wiperight
* wipeup
* zoomin
* zoominout
* zoomout
* :var:`zoomin`
* :var:`zoominout`
* :var:`zoomout`
-4
View File
@@ -15,8 +15,6 @@
`screen`
The name of the screen used to display the menu.
In each pair the first element of which is a textual label, and the second item
.. function:: renpy.display_menu(items, interact=True, screen="choice")
@@ -33,6 +31,4 @@
`screen`
The name of the screen used to display the menu.
In each pair the first element of which is a textual label, and the second item
+26
View File
@@ -0,0 +1,26 @@
.. Automatically generated file - do not modify.
.. function:: renpy.say(who, what, interact=True)
The equivalent of the say statement.
`who`
Either the character that will say something, None for the narrator,
or a string giving the character name. In the latter case, the
:func:`say` is used to create the speaking character.
`what`
A string giving the line to say. Percent-substitutions are performed
in this string.
`interact`
If true, Ren'Py waits for player input when displaying the dialogue. If
false, Ren'Py shows the dialogue, but does not perform an interaction.
This function is rarely necessary, as the following three lines are
equivalent. ::
e "Hello, world."
$ renpy.say(e, "Hello, world.")
$ e("Hello, world.")
-6
View File
@@ -1,6 +0,0 @@
.. Automatically generated file - do not modify.
.. method:: redraw(delay=0)
Causes this SpriteManager to be redrawn in `delay` seconds.
+4
View File
@@ -86,3 +86,7 @@
Creates a new Sprite for the displayable `d`, and adds it to this
SpriteManager.
.. method:: redraw(delay=0)
Causes this SpriteManager to be redrawn in `delay` seconds.
-12
View File
@@ -1,12 +0,0 @@
.. Automatically generated file - do not modify.
.. function:: build._(s)
Flags a string as translatable, and returns it immediately. The string
will be translated when text displays it.
.. function:: updater._(s)
Flags a string as translatable, and returns it immediately. The string
will be translated when text displays it.
+11
View File
@@ -14,6 +14,17 @@
This can be called from inside the render and event methods of a
creator-defined displayable.
.. function:: renpy.map_event(ev, keysym)
Returns true if the pygame event `ev` matches `keysym`
`keysym`
One of:
* The name of a keybinding in :var:`config.keymap`.
* A keysym, as documented in the :ref:`keymap` section.
* A list containing one or more keysyms.
.. function:: renpy.render(d, width, height, st, at)
Causes a displayable to be rendered, and a renpy.Render object to
+22
View File
@@ -356,3 +356,25 @@ Rollback-blocking and -fixing Functions
.. include:: inc/blockrollback
NoRollback
==========
.. include:: inc/norollback
For example::
init python:
class MyClass(NoRollback):
def __init__(self):
self.value = 0
label start:
$ o = MyClass()
"Welcome!"
$ o.value += 1
"o.value is [o.value]. It will increase each time you rolllback and then click ahead."
+2
View File
@@ -58,6 +58,8 @@ arguments, or pass them to a character function. Doing this will
allow the game to continue working if Ren'Py adds additional keyword
arguments to character calls.
.. include:: inc/se_say
Choice Menus
============