[seed] Same Seed: Update closing animation to use a single timeline



commit ba1d103653fb1a3391b967f4211619e5a9ed6148
Author: Tim Horton <hortont svn gnome org>
Date:   Thu May 7 22:52:20 2009 -0400

    Same Seed: Update closing animation to use a single timeline
---
 examples/same-seed/board.js |    6 +++++-
 examples/same-seed/light.js |   15 ++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/examples/same-seed/board.js b/examples/same-seed/board.js
index 7eddafa..10af498 100644
--- a/examples/same-seed/board.js
+++ b/examples/same-seed/board.js
@@ -217,8 +217,12 @@ Board = new GType({
 			if(cl.length < 2)
 				return false;
 			
+			var close_timeline = new Clutter.Timeline({duration: 500});
+			
 			for(var i in cl)
-				cl[i].close_tile();
+				cl[i].close_tile(close_timeline);
+			
+			close_timeline.start();
 			
 			var real_x = 0, timeline = 0;
 			
diff --git a/examples/same-seed/light.js b/examples/same-seed/light.js
index bc2d38d..5a8eb25 100644
--- a/examples/same-seed/light.js
+++ b/examples/same-seed/light.js
@@ -31,25 +31,22 @@ Light = new GType({
 			return state;
 		};
 		
-		this.animate_out = function ()
+		this.animate_out = function (timeline)
 		{
-			this.on.anim = this.on.animate(Clutter.AnimationMode.LINEAR,500,
+			this.on.anim = this.on.animate_with_timeline(Clutter.AnimationMode.LINEAR, timeline,
 			{
 				height: [GObject.TYPE_INT, tile_size * 2],
 				width: [GObject.TYPE_INT, tile_size * 2],
 				x: [GObject.TYPE_INT, -tile_size/2],
 				y: [GObject.TYPE_INT, -tile_size/2]
 			});
-			this.on.anim.timeline.start();
 			
-			this.on.anim.timeline.signal.completed.connect(this.hide_light, this);
-			
-			this.anim = this.animate(Clutter.AnimationMode.LINEAR,500,
+			this.anim = this.animate_with_timeline(Clutter.AnimationMode.LINEAR, timeline,
 			{
 				opacity: [GObject.TYPE_UCHAR, 0]
 			});
 			
-			this.anim.timeline.start();
+			timeline.signal.completed.connect(this.hide_light, this);
 			
 			GLib.main_context_iteration();
 		};
@@ -74,10 +71,10 @@ Light = new GType({
 			return closed;
 		};
 		
-		this.close_tile = function ()
+		this.close_tile = function (timeline)
 		{
 			closed = true;
-			this.animate_out();
+			this.animate_out(timeline);
 		};
 		
 		this.hide_light = function (timeline, light)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]