[seed] clutter extension: Add wrapper for animate_with_alpha



commit c995b68cdd372129aed51335ed6242b758c4850f
Author: Tim Horton <hortont424 gmail com>
Date:   Wed Oct 28 00:25:27 2009 -0400

    clutter extension: Add wrapper for animate_with_alpha

 extensions/Clutter.js |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/extensions/Clutter.js b/extensions/Clutter.js
index 12e63d7..574eda1 100644
--- a/extensions/Clutter.js
+++ b/extensions/Clutter.js
@@ -43,3 +43,25 @@ Clutter.Actor.prototype.animate_with_timeline = function(mode, timeline, json)
     
     return animation;
 }
+
+Clutter.Actor.prototype.animate_with_alpha = function(alpha, json)
+{
+    var properties = new Array();
+    var endvalues = new Array();
+    for (var prop in json)	{
+	properties.push(prop);
+	endvalues.push(new Array(this.__property_type(prop), json[prop]));
+    }
+
+    var animation = 
+	this.animate_with_alphav(alpha, properties.length, 
+				    properties, endvalues);
+    
+    animations.push(animation);
+    animation.timeline.signal["completed"].connect(
+	function(timeline, obj){
+	    animations.splice(animations.indexOf(animation),1);
+	}, this);
+    
+    return animation;
+}



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