renpy/doc/reference/functions/FactorZoom - Ren'Py

documentation index ◦ reference manual ◦ function index

# FactorZoom

Function: | FactorZoom | (size, start, end, time, after_child=None, time_warp=None, bilinear=True, opaque=True, **properties):

This causes a zoom to take place, using image scaling. When used as an `at` clause, this creates a displayable. The render of this displayable is always of the supplied size. The child displayable is rendered, and then scaled by an appropriate factor, interpolated between the start and end factors. The rectangle is then scaled to the supplied size. The zoom will take time seconds, after which it will show the end, unless an after_child is given.

The algorithm used for scaling does not perform any interpolation or other smoothing.

size - The size that the rectangle is scaled to, a (width, height) tuple.

start - The start zoom factor, a floating point number.

end - The end zoom factor, a floating point number.

time - The amount of time it will take to interpolate from the start to the end factors.

after_child - If present, a second child widget. This displayable will be rendered after the zoom completes. Use this to snap to a sharp displayable after the zoom is done.

time_warp - If not None, a function that takes a fractional period (between 0.0 and 0.1), and returns a fractional period. Use this to implement non-linear zooms. This function may be pickled, so it cannot be a lambda or other non-top-level function.

bilinear - If True, the default, this will use bilinear filtering. If false, this will use ugly yet fast nearest neighbor filtering.

opaque - If True and bilinear is True, this will use a very efficient method that does not support transparency. If False, this supports transparency, but is less efficient.

## Example

    show eileen happy at FactorZoom(0.5, 1.0, 2.0, opaque=False), center

    "FactorZoom can scale displayables up and down in size."

documentation index ◦ reference manual ◦ function index