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

ImageDissolve

Function: ImageDissolve( image, time, ramplen=8, ramptype='linear', ramp=None, reverse=False, old_widget=None, new_widget=None)

This dissolves the old scene into the new scene, using an image to control the dissolve process.

A list of values is used to control this mapping. This list of values consists 256 fully transparent values, a ramp (of a specified number of steps) from full transparency to full opacity, and 256 fully opaque values. A 256 entry window is slid over this list, and the values found within are used to map the red channel of the image onto the opacity of the new scene.

Basically, this means that white pixels come in first, black last, and the ramp controls the sharpness of the transition.

image - The image that will be used to control this transition. The image should be the same size as the scene being dissolved.

time - The amount of time the dissolve will take.

ramplen - The number of pixels of ramp to use. This defaults to 8.

ramptype - Type of alpha ramp. Possible types are: linear, cube, dcube, mcube. Default is linear. Non-linear types must have ramplen >= 8. "cube": Ease in, sharp out. "dcube": Sharp in, sharp out. "mcube": Ease in, ease out.

ramp - If given, this is expected to be a sequence of integers in the range 0 to 255. This sequence explicitly gives the ramp to be used. If given, this overrides ramplen and ramptype.

reverse - This reverses the ramp and the direction of the window slide. When True, black pixels dissolve in first, and white pixels come in last.

Example

init:
    $ slowcirciris = ImageDissolve("circiris.png", 5.0, 8)
    $ circirisout = ImageDissolve("circiris.png", 1.0, 8)
    $ circirisoutramp = ImageDissolve("circiris.png", 3.0, ramp=[ 16 * i for i in range(0, 15) + range(15, 0, -1) + range(0, 15) + range(15, 0, -1) + range(0, 15)  + range(15, 0, -1) + range(0, 15) ] )
    $ circirisin = ImageDissolve("circiris.png", 1.0, 8, reverse=True)

    $ demotrans = ImageDissolve("demotrans.png", 3.0, 16)

e "ImageDissolve allows us to have dissolve transitions that are
   controlled by images."

e "This lets us specify very complex transitions, fairly
   simply."

e "Let's try some, and then I'll show how they work."

e "There are two ImageDissolve transitions present by
   default in the standard config."
            
scene black with blinds
scene bg washington
show eileen happy
with blinds

e "The blinds transition opens and closes what looks like
   vertical blinds."

scene black with squares
scene bg washington
show eileen happy
with squares

e "The squares transition uses these squares to show
   things."

e "I'm not sure why anyone would want to use it, but it
   was used in some translated games, so we added it."

e "There are also a few transitions that aren't in the
   standard config."

e "These ones require images the size of the screen, and
   so we couldn't include them as the size of the screen
   can change from game to game."

e "You can find them defined in the source of the demo
   script."

scene black with circirisin

e "We can hide things with a circirisin..."

with None
scene bg washington
with circirisout

e "... and show them again with a circirisout."

e "The ramp parameter lets things dissolve in and out
   along the way."

scene bg whitehouse with circirisoutramp

e "It's even possible to have weird custom transitions."

scene circiris with demotrans

e "What we're showing here is the picture that's used in
   the circiris transitions."

e "If you take a look, the center of it is white, while
   the edges are darker."

e "When we use an ImageDissolve, the white will dissolve
   in first, followed by progressively darker colors."

e "Let's try it."

with None
scene bg washington
show eileen happy
with slowcirciris

            
e "It's also possible to reverse the transition, so that
   the black pixels are dissolved in first."
Reference Manual: (offline | online) Quickstart: (offline | online)