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()

Reply via email to