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.


Efecto de visión doble

El siguiente código produce un efecto borroso de "Visión Doble" (como de borracho). Este efecto se ha usado en los juegos "Gakuen Redux" y "Secretary of Death".

La idea básica es que crees una imagen medio opaca del fondo, y luego mostrarla en ubicación aleatoria después de mostrar el fondo. Esto significa que, a diferencia de otros muchos efectos, llamar este efecto requiere dos declaraciones, no una sola.

init:

    image cs2 = Image("b_city_scape_02.gif")
    image cs2alpha = im.Alpha("b_city_scape_02.gif", 0.5)

    python hide:

        def gen_randmotion(count, dist, delay):

            import random

            args = [ ]

            for i in range(0, count):
                args.append(anim.State(i, None,
                                       Position(xpos=random.randrange(-dist, dist),
                                                ypos=random.randrange(-dist, dist),
                                                xanchor='left',
                                                yanchor='top',
                                                )))

            for i in range(0, count):
                for j in range(0, count):

                    if i == j:
                        continue

                    args.append(anim.Edge(i, delay, j, MoveTransition(delay)))

            return anim.SMAnimation(0, *args)

        store.randmotion = gen_randmotion(5, 5, 1.0)

label start:

    scene cs2
    show cs2alpha at randmotion

    "Presented in DOUBLE-VISION (where drunk)."

En este código, las declaraciones que reproducen el efecto en la historia son:

    scene cs2
    show cs2alpha at randmotion

Como te puedes dar cuenta, para cada imagen que quieras mostrar en visión doble, tienes que crear las dos imágenes también. Para el código superior, éstas son las lineas que crean las imágenes (Nótese que como todas las declaraciones de imágenes, deben ser colocadas en el bloque init):

    image cs2 = Image("b_city_scape_02.gif")
    image cs2alpha = im.Alpha("b_city_scape_02.gif", 0.5)