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
|
.. _transforms:
==========
Transforms
==========
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 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
==================
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 |
| |
| |
| |
| |
offscreenleft|left center, default right|offscreenright
+-----------------------------------------------------------+
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:
.. var:: center
Centers horizontally, and aligns to the bottom of the screen.
.. var:: default
Centers horizontally, and aligns to the bottom of the screen. This
can be redefined via :var:`config.default_transform` to change the
default placement of images shown with the show or scene statements.
.. var:: left
Aligns to the bottom-left corner of the screen.
.. var:: offscreenleft
Places the displayable off the left side of the screen,
aligned to the bottom of the screen.
.. var:: offscreenright
Places the displayable off the left side of the screen,
aligned to the bottom of the screen.
.. var:: reset
Resets the transform. Places the displayable in the top-left
corner of the screen, and also eliminates any zoom, rotation, or
other effects.
.. var:: right
Aligns to the bottom-right corner of the screen.
.. var:: top
Centers horizontally, and aligns to the top of the screen.
.. var:: topleft
Aligns to the top-left corner of the screen.
.. var:: topright
Aligns to the top-right corner of the screen.
.. var:: truecenter
Centers both horizontally and vertically.
Creator-Defined Transforms
==========================
A creator can define a transform using the
:doc:`animation and transformation language <atl>`, or the
:class:`Transform` function.
|