6
{ "id" : "move-timeline", "type" : "ClutterTimeline", "duration" : 2500 },
7
{ "id" : "scale-timeline", "type" : "ClutterTimeline", "duration" : 2000 },
8
{ "id" : "fade-timeline", "type" : "ClutterTimeline", "duration" : 1500 },
10
"id" : "move-behaviour", "type" : "ClutterBehaviourPath",
12
"timeline" : "move-timeline",
13
"function" : "clutter_sine_inc_func"
21
"id" : "scale-behaviour", "type" : "ClutterBehaviourScale",
22
"x-scale-start" : 1.0, "x-scale-end" : 0.7,
23
"y-scale-start" : 1.0, "y-scale-end" : 0.7,
25
"timeline" : "scale-timeline",
26
"function" : "sine-inc"
30
"id" : "fade-behaviour", "type" : "ClutterBehaviourOpacity",
31
"opacity-start" : 255, "opacity-end" : 0,
33
"timeline" : "fade-timeline",
34
"function" : "sine-inc"
39
"type" : "ClutterStage",
44
{ "name" : "key-press-event", "handler" : "do_quit" },
45
{ "name" : "destroy", "handler" : "do_quit" }
50
"type" : "ClutterRectangle",
55
"x" : 100, "y" : 100, "width" : 300, "height" : 300,
57
{ "z-axis" : [ 45.0, [ 200, 200 ] ] }
60
{ "name" : "button-press-event", "handler" : "do_press" }
74
def __init__ (self, *args, **kwargs):
75
self._score = clutter.Score()
77
def do_quit (self, *args):
81
def do_timeline_start (self, score, timeline):
82
print "timeline started: %s" % (clutter.get_script_id(timeline))
84
def do_press (self, actor, event):
85
print "running the score"
86
self._score.connect('timeline-started', self.do_timeline_start)
87
self._score.connect('completed', self.do_quit)
92
def load_script (self):
93
self._script = clutter.Script()
95
self._script.load_from_data(BUFFER, -1)
96
self._script.connect_signals(self)
97
except Exception, exc:
98
print "Unable to load buffer: %s" % (exc)
104
self._timelines = self._script.get_objects('move-timeline',
107
for timeline in self._timelines:
108
print "Timeline: %s" % (clutter.get_script_id (timeline))
110
self._score.append(timeline=self._timelines[0])
111
self._score.append(timeline=self._timelines[1], parent=self._timelines[0])
112
self._score.append(timeline=self._timelines[2], parent=self._timelines[1])
113
assert(3 == len(self._score.list_timelines()))
115
self._stage = self._script.get_object('main-stage')
116
self._stage.show_all()
122
if __name__ == '__main__':