Hi, you should use anim.connect_after. See http://www.clutter-project.org/docs/clutter/stable/clutter-Implicit-Animations.html#clutter-actor-animate for details
so long
:wq buz
On Mon, Aug 31, 2009 at 03:11:09PM +0100, Karl Lattimer wrote:
> Hi all,
>
> I'm trying to chain together a couple of animations using
> ClutterActor.animate in python, however if I use the completed signal
> from the animation to start off a second animation the second animation
> jumps to the end rather than playing through.
>
> Attached is a simple example of the problem I'm having, if you click
> anywhere on the stage two animations should occur one following the
> others completed, however the second animation appears to end at the
> first frame.
>
> BR,
> K
>
>
>
> import clutter
> import cairo
> import math
>
> class TestActor(clutter.CairoTexture):
> def __init__( self ):
> clutter.CairoTexture.__init__(self, 50, 50)
> cr = self.cairo_create()
> cr.arc(25, 25, 24, 0.0, 2*math.pi)
> cr.set_source_rgba(1,0,1,0.5)
> cr.fill()
>
> def start_move( self, blah, blab ):
> anim = self.animate(clutter.LINEAR, 800, "x", 200)
> anim.connect("completed", self.chain)
>
> def chain( self, anim ):
> self.animate(clutter.LINEAR, 800, "x", 0)
>
> if __name__ == '__main__':
> bg_color = clutter.Color(0xe0, 0xf2, 0xfc, 0xff)
> stage = clutter.Stage()
> stage.set_size(300, 300)
> stage.set_color(bg_color)
> stage.connect('destroy', clutter.main_quit)
> actor = TestActor()
> stage.add(actor)
>
> stage.connect('button-press-event', actor.start_move)
>
> stage.show_all()
>
> clutter.main()
--
"Either toss the Windows out of your computer, or toss your computer
out the window!" -- Richard Stallman
GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0 FD53 8C35 FD2E 6908 7B82
signature.asc
Description: Digital signature
