[seed] Same Seed: More transitioning to single-timeline animation; this time, the main block animation
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Same Seed: More transitioning to single-timeline animation; this time, the main block animation
- Date: Thu, 7 May 2009 22:58:00 -0400 (EDT)
commit 30ebe185c571ac3669b0d0a16c5b0fbcc5d174e8
Author: Tim Horton <hortont svn gnome org>
Date: Thu May 7 22:57:06 2009 -0400
Same Seed: More transitioning to single-timeline animation; this time, the main block animation
---
examples/same-seed/board.js | 18 +++++-------------
examples/same-seed/light.js | 6 +-----
2 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/examples/same-seed/board.js b/examples/same-seed/board.js
index 10af498..c64fdef 100644
--- a/examples/same-seed/board.js
+++ b/examples/same-seed/board.js
@@ -228,7 +228,7 @@ Board = new GType({
animating = true;
- //timeline = new Clutter.Timeline({duration: 500});
+ var anim_timeline = new Clutter.Timeline({duration: 500});
for(var x in lights)
{
@@ -263,15 +263,7 @@ Board = new GType({
if(!li.get_closed() && ((new_x != li.x) ||
(new_y != li.y)))
{
- timeline = li.animate_to(new_x, new_y, timeline);
-
- // This might go away after we can pass timelines around
- /*var nullize_anim = function (asdf, li)
- {
- li.anim = null;
- };
-
- timeline.signal.completed.connect(nullize_anim, li);*/
+ li.animate_to(new_x, new_y, anim_timeline);
}
if(!li.get_closed())
@@ -286,13 +278,13 @@ Board = new GType({
real_x++;
}
- //timeline.start();
+ anim_timeline.start();
- if(timeline && li.anim)
+ if(anim_timeline && li.anim)
// This needs to be changed when we get the ability
// to pass timelines around.... will fix bugs on
// slower machines / boards with many tiles
- timeline.signal.completed.connect(done_animating);
+ anim_timeline.signal.completed.connect(done_animating);
else
animating = false;
diff --git a/examples/same-seed/light.js b/examples/same-seed/light.js
index 5a8eb25..dfc55d6 100644
--- a/examples/same-seed/light.js
+++ b/examples/same-seed/light.js
@@ -53,17 +53,13 @@ Light = new GType({
this.animate_to = function (new_x, new_y, timeline)
{
- this.anim = this.animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, 500,
+ this.anim = this.animate_with_timeline(Clutter.AnimationMode.EASE_OUT_BOUNCE, timeline,
{
x: [GObject.TYPE_INT, new_x],
y: [GObject.TYPE_INT, new_y]
});
- this.anim.timeline.start();
-
GLib.main_context_iteration();
-
- return this.anim.timeline;
};
this.get_closed = function ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]