### Navigation

- index
- next |
- previous |
- Ren'Py Home |
- Ren'Py Documentation

# Other Functions

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.

`renpy.``call`(label, *args, **kwargs)

  Causes the current Ren'Py statement to terminate, and a jump to a label to occur. When the jump returns, control will be passed to the statement following the current statement.

`renpy.``clear_game_runtime`()

  Resets the game runtime counter.

`renpy.``focus_coordinates`()

  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.

`renpy.``fsdecode`(s)

  Converts s from filesystem encoding to unicode.

`renpy.``fsencode`(s)

  Converts s from unicode to the filesystem encoding.

`renpy.``get_game_runtime`()

  Returns the game runtime counter.

  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.)

`renpy.``get_image_load_log`(age=None)

  A generator that yields a log of image loading activity. For the last 100 image loads, this returns:

  - The time the image was loaded (in seconds since the epoch).
  - The filename of the image that was loaded.
  - A boolean that is true if the image was preloaded, and false if the game stalled to load it.

  The entries are ordered from newest to oldest.

  age
    If not None, only images that have been loaded in the past age seconds are included.

  The image load log is only kept if config.developer = True.

`renpy.``get_physical_size`()

  Returns the size of the physical window.

`renpy.``get_renderer_info`()

  Returns a dictionary, giving information about the renderer Ren'Py is currently using. The dictionary has one required key:

  `"renderer"`
    One of `"gl"` or `"sw"`, corresponding to the OpenGL and software renderers, respectively.
  `"resizable`
    True if and only if the window is resizable.

  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).

`renpy.``get_say_attributes`()

  Gets the attributes associated with the current say statement, or None if no attributes are associated with this statement.

  This is only valid when executing or predicting a say statement.

`renpy.``get_side_image`(prefix_tag, image_tag=None, not_showing=True, layer='master')

  This attempts to find an image to show as the side image.

  It begins by determining a set of image attributes. If image_tag is given, it gets the image attributes from the tag. Otherwise, it gets them from the currently showing character.

  It then looks up an image with the tag prefix_tag and those attributes, and returns it if it exists.

  If not_showing is True, this only returns a side image if the image the attributes are taken from is not on the screen.

`renpy.``image_size`(im)

  Given an image manipulator, loads it and returns a (`width`, `height`) tuple giving its size.

  This reads the image in from disk and decompresses it, without using the image cache. This can be slow.

`renpy.``list_files`(common=False)

  Lists the files in the game directory and archive files. Returns a list of files, with / as the directory separator.

  common
    If true, files in the common directory are included in the listing.

`renpy.``notify`(message)

  Causes Ren'Py to display the message using the notify screen. By default, this will cause the message to be dissolved in, displayed for two seconds, and dissolved out again.

  This is useful for actions that otherwise wouldn't produce feedback, like screenshots or quicksaves.

  Only one notification is displayed at a time. If a second notification is displayed, the first notification is replaced.

`renpy.``rollback`(force=False, checkpoints=1, defer=False, greedy=True, label=None)

  Rolls the state of the game back to the last checkpoint.

  force
    If true, the rollback will occur in all circumstances. Otherwise, the rollback will only occur if rollback is enabled in the store, context, and config.
  checkpoints
    Ren'Py will roll back through this many calls to renpy.checkpoint. It will roll back as far as it can, subject to this condition.
  defer
    If true, the call will be deferred until code from the main context is executed.
  greedy
    If true, rollback will occur just before the previous checkpoint. If false, rollback occurs to just before the current checkpoint.
  label
    If not None, a label that is called when rollback completes.

`renpy.``set_physical_size`(size)

  Attempts to set the size of the physical window to size. This has the side effect of taking the screen out of fullscreen mode.

`renpy.``vibrate`(duration)

  Causes the device to vibrate for duration seconds. Currently, this is only supported on Android.

`renpy.music.``register_channel`(name, mixer=None, loop=None, stop_on_mute=True, tight=False, file_prefix='', file_suffix='', buffer_queue=True)

  This registers a new audio channel named name. Audio can then be played on the channel by supplying the channel name to the play or queue statements.

  mixer
    The name of the mixer the channel uses. By default, Ren'Py knows about the "music", "sfx", and "voice" mixers. Using other names is possible, but may require changing the preferences screens.
  loop
    If true, sounds on this channel loop by default.
  stop_on_mute
    If true, music on the channel is stopped when the channel is muted.
  tight
    If true, sounds will loop even when fadeout is occuring. This should be set to True for a sound effects or seamless music channel, and False if the music fades out on its own.
  file_prefix
    A prefix that is prepended to the filenames of the sound files being played on this channel.
  file_suffix
    A suffix that is appended to the filenames of the sound files being played on this channel.
  buffer_queue
    Should we buffer the first second or so of a queued file? This should be True for audio, and False for movie playback.

`layout.``yesno_screen`(message, yes=None, no=None)

  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.

  message
    The message that will be displayed.
  yes
    An action that is run when the user chooses yes.
  no
    An action that is run when the user chooses no.

`updater.``fsencode`(s)

  Converts s from unicode to the filesystem encoding.

### Navigation

- index
- next |
- previous |
- Ren'Py Home |
- Ren'Py Documentation