[seed] clutter-pad: Make the clutter-pad example a little shinier



commit 0c0f8aea5aabdc7d4823a9bb8e1172468d1f6efd
Author: Robert Carr <racarr svn gnome org>
Date:   Wed May 13 21:40:43 2009 -0400

    clutter-pad: Make the clutter-pad example a little shinier
---
 doc/reference/html/index.html                      |    3 --
 .../clutter-pad/examples/animated-rectangle.js     |   33 ++++++++++++-------
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/doc/reference/html/index.html b/doc/reference/html/index.html
index 721787d..afed95d 100644
--- a/doc/reference/html/index.html
+++ b/doc/reference/html/index.html
@@ -28,9 +28,6 @@
 <dt><span class="chapter"><a href="ch01.html">General Seed Functions</a></span></dt>
 <dd><dl>
 <dt>
-<span class="refentrytitle"><a href="seed-seed.html">seed</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
 <span class="refentrytitle"><a href="seed-SeedContext.html">SeedContext</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
diff --git a/examples/clutter-pad/examples/animated-rectangle.js b/examples/clutter-pad/examples/animated-rectangle.js
index 8b952fc..c257d85 100644
--- a/examples/clutter-pad/examples/animated-rectangle.js
+++ b/examples/clutter-pad/examples/animated-rectangle.js
@@ -2,16 +2,25 @@ GObject = imports.gi.GObject;
 Clutter = imports.gi.Clutter;
 stage = Clutter.Stage.get_default();
 
-rect = new Clutter.Rectangle();
-rect.color = {red: 255, alpha: 255};
-rect.x = rect.y = 0;
-rect.width = rect.height = 25;
-stage.add_actor(rect);
+colors = [{red: 255, alpha: 255},
+		{green: 255, alpha: 255},
+		{blue: 255, alpha: 255},
+		{red: 255, green: 255, alpha: 255}]
 
-anim = rect.animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, 1500,
-{
-	height: [GObject.TYPE_INT, 100],
-	width: [GObject.TYPE_INT, 100],
-	x: [GObject.TYPE_INT, stage.width - 100],
-	y: [GObject.TYPE_INT, stage.height - 100]
-});
\ No newline at end of file
+for (i = 0; i < 4; i++){
+    rect = new Clutter.Rectangle();
+    rect.color = colors[i];
+    rect.x = rect.y = 0;
+	rect.x += i *25;
+    rect.width = rect.height = 25;
+    stage.add_actor(rect);
+    
+   rect.anim = rect.animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, 1500+500*i,
+		     {
+			 height: [GObject.TYPE_INT, 100],
+			 width: [GObject.TYPE_INT, 100],
+			 x: [GObject.TYPE_INT, stage.width - 100*(i+1)],
+			 y: [GObject.TYPE_INT, stage.height - 100],
+			rotation_angle_z: [GObject.TYPE_DOUBLE, 360],
+		     });
+}



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