Hi everyone,
I'm using pyclutter 0.8 and I would like to have some help with
clutter.BehaviourPath
I want to move an actor along a path and make it stay at the final point of the
path.
Nevertheless when I'm using clutter.BehaviourPath, the actor is moving but it's
going back to its original position. How could I fix it at the final point of
my path ?
Here is a code example of my problem :
import clutter
class interface():
def __init__(self):
# Stage
stage = clutter.Stage()
stage.set_size(780, 480)
stage.set_title('Clutter Interface')
color_black = clutter.Color(0,0,0,255)
color_blue = clutter.Color(0,0,255,255)
stage.set_color(color_black)
stage.connect('destroy', self.QuitStage) # Quitter l'application
stage.show()
# Rectangle
rectangle = clutter.Rectangle()
rectangle.set_color(color_blue)
rectangle.set_size(80,80)
rectangle.set_position(100,200)
stage.add(rectangle)
rectangle.show()
# Animation
timeline = clutter.Timeline(fps=60, duration=1500)
timeline.set_loop(False)
alpha = clutter.Alpha(timeline, clutter.sine_func)
behaviour_path = clutter.BehaviourPath(alpha = alpha)
behaviour_path.append_knots((100,200), (400,200))
behaviour_path.apply(rectangle)
timeline.start()
clutter.main()
def QuitStage(self, stage):
clutter.main_quit()
if __name__ == '__main__':
app = interface()