コード例 #1
0
ファイル: new_wish.py プロジェクト: psederberg/pynamite
def true_wish():
    # define some actors
    x = TextBox("Jubba")
    y = TextBox("Wubba")
    f = Flame()
    
    # turn some into a group
    g = Group(x,y)

    # set some starting opacities
    g.opacity = 0.0

    # bring out the group
    g.enter()

    # fade in and out at same time, while showing fire
    with parallel():
        # smooth takes start, end, and duration
        x.opacity = smooth_to(.5,duration=2.0)
        y.opacity = smooth_to(.5,duration=2.0)
        # the flame can burn
        with serial():
            # enter the flame
            f.enter()
            # wait a sec to start
            wait(1.0)
            # burn the flame for a sec
            f.burn(1.0)
            # then leave
            f.leave()

    # Wait for keypress before continuing
    pause()
    
    # group leaves the stage
    g.leave()
コード例 #2
0
ファイル: working.py プロジェクト: psederberg/pynamite
def scene1():
    # define some actors
    x = TextBox("Pynamite")
    y = TextBox("Rocks!!!", "Georgia")
    b = GradientBox()
    b.enter()
    
    # tell the first actor to enter
    enter(x)
    
    # wait for a keypress to continue
    pause()

    # fade out one actor while other comes in
    y.set_cx(0.0)
    y.set_cy(0.0)
    with parallel():
        fadein(2.0,y)
        y.set_cx(.5,duration=2.0,func="smooth")
        y.set_cy(.5,duration=2.0,func="smooth")
        fadeout(1.0,x)

    # wait for input
    pause()
    #wait(1.0)

    # last actor leaves
    with parallel():
        fadeout(2.0,y)
        y.set_cx(1.0,duration=2.0,func="smooth")
        y.set_cy(1.0,duration=2.0,func="smooth")
        with serial():
            wait(1.0)
            b.fadeout(2.0)
コード例 #3
0
ファイル: working.py プロジェクト: psederberg/pynamite
def scene2():
    # define the actor
    x = TextBox("Yes, it Rocks!!!", "Georgia")
    b = GradientBox()
    b.fadein(1.0)
    
    # set its opacity to 0.0
    x.set_opacity(0.0)
    
    # have it enter (but remember it's still not visible)
    x.enter()
    
    # have it become visible, but in a fancy way
    x.set_opacity(.5, duration=.5, func="smooth")
    x.set_opacity(.25, duration=.25, func="smooth")
    x.set_opacity(.75, duration=.5, func="smooth")
    x.set_opacity(.5, duration=.25, func="smooth")
    x.set_opacity(1.0, duration=.5, func="smooth")

    # wait for input
    pause()

    # have the actor leave
    x.fadeout(1.0)