documentation indexreference manualfunction index

CropMove

Function: CropMove (time, mode='fromleft', startcrop=(0.0, 0.0, 0.0, #0), startpos=(0.0, 0.0), endcrop=(0.0, 0.0, #0, #0), endpos=(0.0, 0.0), topnew=True, old_widget=None, new_widget=None):

The CropMove transition works by placing the old and the new image on two layers, called the top and the bottom. (Normally the new image is on the top, but that can be changed in some modes.) The bottom layer is always drawn in full. The top image is first cropped to a rectangle, and then that rectangle drawn onto the screen at a specified position. Start and end crop rectangles and positions can be selected by the supplied mode, or specified manually. The result is a surprisingly flexible transition.

This transition has many modes, simplifying its use. We can group these modes into three groups: wipes, slides, and other.

In a wipe, the image stays fixed, and more of it is revealed as the transition progresses. For example, in "wiperight", a wipe from left to right, first the left edge of the image is revealed at the left edge of the screen, then the center of the image, and finally the right side of the image at the right of the screen. Other supported wipes are "wipeleft", "wipedown", and "wipeup".

In a slide, the image moves. So in a "slideright", the right edge of the image starts at the left edge of the screen, and moves to the right as the transition progresses. Other slides are "slideleft", "slidedown", and "slideup".

There are also slideaways, in which the old image moves on top of the new image. Slideaways include "slideawayright", "slideawayleft", "slideawayup", and "slideawaydown".

We also support a rectangular iris in with "irisin" and a rectangular iris out with "irisout". Finally, "custom" lets the user define new transitions, if these ones are not enough.

time - The time that this transition will last for, in seconds.

mode - One of the modes given above.

The following parameters are only respected if the mode is "custom".

startcrop - The starting rectangle that is cropped out of the top image. A 4-element tuple containing x, y, width, and height.

startpos - The starting place that the top image is drawn to the screen at, a 2-element tuple containing x and y.

startcrop - The starting rectangle that is cropped out of the top image. A 4-element tuple containing x, y, width, and height.

startpos - The starting place that the top image is drawn to the screen at, a 2-element tuple containing x and y.

topnew - If True, the top layer contains the new image. Otherwise, the top layer contains the old image.

Example

init:
    $ wiperight = CropMove(1.0, "wiperight")
    $ wipeleft = CropMove(1.0, "wipeleft")
    $ wipeup = CropMove(1.0, "wipeup")
    $ wipedown = CropMove(1.0, "wipedown")

    $ slideright = CropMove(1.0, "slideright")
    $ slideleft = CropMove(1.0, "slideleft")
    $ slideup = CropMove(1.0, "slideup")
    $ slidedown = CropMove(1.0, "slidedown")

    $ slideawayright = CropMove(1.0, "slideawayright")
    $ slideawayleft = CropMove(1.0, "slideawayleft")
    $ slideawayup = CropMove(1.0, "slideawayup")
    $ slideawaydown = CropMove(1.0, "slideawaydown")

    $ irisout = CropMove(1.0, "irisout")
    $ irisin = CropMove(1.0, "irisin")

e "The CropMove transition class lets us provide a wide
               range of transition effects."

hide eileen with dissolve

e "I'll stand offscreen, so you can see some of its modes. I'll read
   out the mode name after each transition."

scene bg whitehouse with wiperight

e "We first have wiperight..."

scene bg washington with wipeleft

e "...followed by wipeleft... "

scene bg whitehouse with wipeup

e "...wipeup..."

scene bg washington with wipedown

e "...and wipedown."

e "Next, the slides."

scene bg whitehouse with slideright

e "Slideright..."

scene bg washington with slideleft

e "...slideleft..."

scene bg whitehouse with slideup

e "...slideup..."

scene bg washington with slidedown

e "and slidedown."

e "While the slide transitions slide in the new scene, the
   slideaways slide out the old scene."

scene bg whitehouse with slideawayright

e "Slideawayright..."

scene bg washington with slideawayleft

e "...slideawayleft..."

scene bg whitehouse with slideawayup

e "...slideawayup..."

scene bg washington with slideawaydown

e "and slideawaydown."

e "We also have a couple of transitions that use a
   rectangular iris."

scene bg whitehouse with irisout

e "There's irisout..."

with None
scene bg washington
show eileen happy
with irisin

e "... and irisin."

e "It's enough to make you feel a bit dizzy."



documentation indexreference manualfunction index