This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


Transitions

By default, Ren'Py displays each scene by replacing the old scene with a new one. This is appropriate in general (such as for emotion changes), but it may be boring for large changes, such as a change in location or a character entering or leaving the scene. Ren'Py supports transitions that control how changes to the scene lists are exposed to the user.

Transitions occur between the last scene that was shown to the user, and the current scene that has been updated using the scene, show, or hide statements. A transition runs for a given amount of time, but may be dismissed early by the user. Once a transition is shown, the scene is considered shown for the purposes of future transitions.

Transitions are introduced with the `with` statement. The `with` statement takes an expression that is suitable for use with the `with` statement (that is, a callable that takes as input two scene lists), and runs that transition. Alternatively, if the expression is `None`, then the `with` statement has the effect of showing the scene to the user, and returning instantly. This is useful in conjunction with a future `with` statement, so that only some changes to the scene list will be transitioned in.

An example is in order. First, let us define a few objects that can be passed in as the argument to a with statement:

init:
    # Fades to black, then to the new scene.
    fade = Fade(0.5, 0, 0.5)

    # Dissolves between old and new scenes.
    dissolve = Dissolve(0.5)

A simple use of with would be to place it after a series of show and hide statements of the program. As an example:

scene bg whitehouse
show eileen happy
with fade

This series of statements will cause the old scene (displayed before these statements started) to fade to black, and be replaced with the new scene all at once. This is a useful behavior, for example, when we are replacing a scene with a new one, such as when the story changes locations.

scene bg whitehouse
with None
show eileen happy
with dissolve

The `with None` statement is useful to break changes to the scene list into parts, as in the example above. When run, the background will be instantly shown, and then the character image will be dissolved in over the background.

Another use of the `with None` statement is to remove transient elements before a transition begins. By default, the scene list includes transient elements like dialogue, thoughts, and menus. `with None` always executes without these elements, and so gets rid of them.

The `show`, `hide`, and `scene` statements all take a with clause. One of these statement with a with clause associated with it is actually converted into three statements: A `with None` statement, the original statement sans the with clause, and the with clause as a with statement. For example:

scene bg whitehouse with fade
show eileen happy at left with dissolve
show lucy happy at right with dissolve

becomes

with None
scene bg whitehouse
with fade
with None
show eileen happy at left
with dissolve
with None
show lucy happy at right
with dissolve

This has the effect of fading out the old scene and fading in the new background, then dissolving in the characters one after the other.

We also allow with clauses to be supplied for say and menu statements. When a with clause is supplied on one of these statements, the transition is used to introduce the say or menu element. For example,

e "How are you doing?" with dissolve

Will dissolve in a line of dialogue. The line of dialogue will be dismissed immediately, unless it is followed by a with statement or clause that causes it to transition to something else.

There is one variable that controls transitions:

If not none, specifies a default transition that is applied to all say and menu statements that are not provided a with clause. This is only considered if the transitions preference is set to "All".

Pre-Defined Transitions

An instance of the transition that takes 0.5 seconds to fade to black, and then 0.5 seconds to fade to the new screen.

An instance of the transition that takes 0.5 seconds to complete.

An instance of the transition, which takes 1 second to complete, and creates pixels as big as 32x32 over the course of 5 steps in either direction.

An instance of the transition, this takes 0.5 seconds to move images that changed position to their new locations.

When invoked, this transition shakes the screen vertically for a quarter second.

When invoked, this transition shakes the screen horizontally for a quarter second.

Transitions the screen in a vertical blinds effect lasting 1 second.

Transitions the screen in a squares effect lasting 1 second.

An instance of that takes 1 second to wipe the screen right.

An instance of that takes 1 second to wipe the screen left.

An instance of that takes 1 second to wipe the screen up.

An instance of that takes 1 second to wipe the screen down.

An instance of that takes 1 second to slide the screen right.

An instance of that takes 1 second to slide the screen left.

An instance of that takes 1 second to slide the screen up.

An instance of that takes 1 second to slide the screen down.

An instance of that takes 1 second to slide the screen away and to the right.

An instance of that takes 1 second to slide the screen away and to the left.

An instance of that takes 1 second to slide the screen away and to the up.

An instance of that takes 1 second to slide the screen away and to the down.

An instance of that irises the screen out for 1 second.

An instance of that irises the screen in for 1 second.

Transition Constructors

The following are functions that return things useful as transitions. The user should not supply the new_widget or old_widget parameters, as these are supplied by Ren'Py when a transition begins.

Some transitions can also be applied to specific layers, using the function. Only transitions that are not completely opaque can be used in this way.