documentation indexreference manualfunction index

ImageDissolve

Function: ImageDissolve (image, time, 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. Basically, this means that white pixels come in first and black last.

The two children should be the same size, or the behavior of ImageDissolve is undefined.

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.

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.

alpha - If True, the resulting displayable will have an alpha channel, at the cost of some speed. If False, it will be treated as opaque, but be faster.

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."



documentation indexreference manualfunction index