許多API已被棄用。我用ClutterPropertyTransition更新了代碼。例如動畫Rect1的矩形,你可以使用:
ClutterTransition *transition = clutter_property_transition_new("rotation-angle-z");
clutter_timeline_set_progress_mode(CLUTTER_TIMELINE(transition), CLUTTER_LINEAR);
clutter_timeline_set_duration(CLUTTER_TIMELINE(transition), msecs);
clutter_timeline_set_repeat_count(CLUTTER_TIMELINE(transition), -1);
clutter_transition_set_animatable(transition, CLUTTER_ANIMATABLE(rect1));
clutter_transition_set_from(transition, G_TYPE_FLOAT, 0.0);
clutter_transition_set_to(transition, G_TYPE_FLOAT, 360.0);
clutter_timeline_start(CLUTTER_TIMELINE(transition));
不要忘記釋放引用的時候做
感謝「轉型」 - 它看起來像我需要一個更先進的最新教程。 – 2014-09-24 19:41:38