Transforms link

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.

Transforms can be applied by giving the at clause to the scene and show statements. The following code applies the "right" transform to the eileen happy displayable.:

show eileen happy at right

Multiple transforms can be applied by separating them with commas. These transforms are applied from left-to-right, with the rightmost transform taking precedence in the case of conflicts.

show eileen happy at halfsize, right

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 default if there is no prior transform.

Default Transforms link

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.

+-----------------------------------------------------------+
|topleft, reset               top                   topright|
|                                                           |
|                                                           |
|                                                           |
|                                                           |
|                          truecenter                       |
|                                                           |
|                                                           |
|                                                           |
|                                                           |
|left                   center, default                right|
+-----------------------------------------------------------+

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

The transforms are:

center link

Centers horizontally, and aligns to the bottom of the screen.

default link

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.

left link

Aligns to the bottom-left corner of the screen.

offscreenleft link

Places the displayable off the left side of the screen, aligned to the bottom of the screen.

offscreenright link

Places the displayable off the left side of the screen, aligned to the bottom of the screen.

reset link

Resets the transform. Places the displayable in the top-left corner of the screen, and also eliminates any zoom, rotation, or other effects.

right link

Aligns to the bottom-right corner of the screen.

top link

Centers horizontally, and aligns to the top of the screen.

topleft link

Aligns to the top-left corner of the screen.

topright link

Aligns to the top-right corner of the screen.

truecenter link

Centers both horizontally and vertically.

Creator-Defined Transforms link

A creator can define a transform using the animation and transformation language, or the Transform function.