Reference Manual: (offline | online) Quickstart: (offline | online)

MoveTransition

Function: MoveTransition( delay, factory=None, enter_factory=None, leave_factory=None)

This transition attempts to find images that have changed position, and moves them from the old position to the new transition, taking delay seconds to complete the move.

If factory is given, it is expected to be a function that takes as arguments: an old position, a new position, the delay, and a displayable, and to return a displayable as an argument. If not given, the default behavior is to move the displayable from the starting to the ending positions.

If enter_factory or leave_factory are given, they are expected to be functions that take as arguments a position, a delay, and a displayable, and return a displayable. They are applied to displayables that are entering or leaving the scene, respectively. The default is to show in place displayables that are entering, and not to show those that are leaving.

Images are considered to be the same if they have the same tag, in the same way that the tag is used to determine which image to replace or to hide. They are also considered to be the same if they are the same displayable.

If you use this transition to slide an image off the side of the screen, remember to hide it when you are done. (Or just use it with a leave_factory.)

There are several constructors that create functions for use with enter_factory and leave_factory:

Example

init:
    $ move = MoveTransition(0.5)

e "The move transition moves around images that have
   changed position."

e "For example..."

show eileen happy at offscreenleft with move

e "I can move over to the offscreenleft position, just off
   the left side of the screen."

show eileen happy at left with move

e "The left position has my left side border the left
   margin of the screen."

show eileen happy at center with move

e "I can also move to the center..."

show eileen happy at right with move

e "... the right ..."

show eileen happy at offscreenright with move

e "... or even to offscreenright, off the right-hand side
   of the screen."

show eileen happy at right with move

e "We don't limit you to these five positions either. You
   can always create your own Position objects."
Reference Manual: (offline | online) Quickstart: (offline | online)