seed r677 - trunk/examples/clutter-transitions
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r677 - trunk/examples/clutter-transitions
- Date: Thu, 8 Jan 2009 04:12:10 +0000 (UTC)
Author: hortont
Date: Thu Jan 8 04:12:10 2009
New Revision: 677
URL: http://svn.gnome.org/viewvc/seed?rev=677&view=rev
Log:
Transition driver script.
Added:
trunk/examples/clutter-transitions/main.js (contents, props changed)
trunk/examples/clutter-transitions/transition-library.js (contents, props changed)
- copied, changed from r676, /trunk/examples/clutter-transitions/clutter.js
Removed:
trunk/examples/clutter-transitions/clutter.js
Added: trunk/examples/clutter-transitions/main.js
==============================================================================
--- (empty file)
+++ trunk/examples/clutter-transitions/main.js Thu Jan 8 04:12:10 2009
@@ -0,0 +1,74 @@
+#!/usr/bin/env seed
+
+Seed.include("transition-library.js");
+
+var stage = new Clutter.Stage();
+stage.signal.hide.connect(function(){Clutter.main_quit()});
+stage.set_size(1024,768);
+stage.show_all();
+
+var black = new Clutter.Color();
+Clutter.color_parse("Black", black);
+stage.color = black;
+
+var begin = new Clutter.Texture.from_file("one.jpg");
+var end = new Clutter.Texture.from_file("two.jpg");
+
+with(begin)
+{
+ filter_quality = Clutter.TextureQuality.High;
+ width = stage.width;
+ height = stage.height;
+}
+
+with(end)
+{
+ filter_quality = Clutter.TextureQuality.High;
+ width = stage.width;
+ height = stage.height;
+}
+
+function completed()
+{
+ stage.remove_all();
+ animate();
+}
+
+var tr = 0;
+
+function next_transition()
+{
+ transitions[tr++]({a:at, b:bt, duration:3, done:completed, direction:d_out});
+
+ return false;
+}
+
+function animate()
+{
+ if(tr >= transitions.length)
+ return;
+
+ if(tr % 2)
+ {
+ at = new Clutter.CloneTexture({parent_texture:begin});
+ bt = new Clutter.CloneTexture({parent_texture:end});
+ }
+ else
+ {
+ at = new Clutter.CloneTexture({parent_texture:end});
+ bt = new Clutter.CloneTexture({parent_texture:begin});
+ }
+
+ at.width = bt.width = stage.width;
+ at.height = bt.height = stage.height;
+
+ stage.add_actor(bt);
+ stage.add_actor(at);
+ stage.show_all();
+
+ GLib.timeout_add(500, next_transition);
+}
+
+animate();
+
+Clutter.main();
Copied: trunk/examples/clutter-transitions/transition-library.js (from r676, /trunk/examples/clutter-transitions/clutter.js)
==============================================================================
--- /trunk/examples/clutter-transitions/clutter.js (original)
+++ trunk/examples/clutter-transitions/transition-library.js Thu Jan 8 04:12:10 2009
@@ -47,7 +47,7 @@
with(t)
{
var timeline = new Clutter.Timeline({num_frames:duration*global_fps, fps:global_fps});
- var effect = new Clutter.EffectTemplate(timeline, Clutter.ramp_inc_func);
+ var effect = new Clutter.EffectTemplate.c_new(timeline, Clutter.ramp_inc_func);
b.opacity = 0;
@@ -243,7 +243,7 @@
{
for(var i = 0; i < stage.width; i += tile_w)
{
- var g = new Clutter.CloneTexture({parent_texture:a});
+ var g = new Clutter.CloneTexture({parent_texture:a.parent_texture});
g.set_clip(i,j,tile_w,tile_h);
g.width = a.width;
@@ -290,7 +290,7 @@
{
for(var i = 0; i < stage.width; i += tile_w)
{
- var g = new Clutter.CloneTexture({parent_texture:a});
+ var g = new Clutter.CloneTexture({parent_texture:a.parent_texture});
g.set_clip(i,j,tile_w,tile_h);
g.width = a.width;
@@ -350,7 +350,7 @@
{
for(var i = 0; i < stage.width; i += tile_w)
{
- var g = new Clutter.CloneTexture({parent_texture:a});
+ var g = new Clutter.CloneTexture({parent_texture:a.parent_texture});
g.set_clip(i,j,tile_w,tile_h);
g.width = a.width;
@@ -405,9 +405,9 @@
{
with(t)
{
- var reflection = new Clutter.CloneTexture({parent_texture:b});
- var left_tile = new Clutter.CloneTexture({parent_texture:a});
- var right_tile = new Clutter.CloneTexture({parent_texture:a});
+ var reflection = new Clutter.CloneTexture({parent_texture:b.parent_texture});
+ var left_tile = new Clutter.CloneTexture({parent_texture:a.parent_texture});
+ var right_tile = new Clutter.CloneTexture({parent_texture:a.parent_texture});
reflection.width = b.width;
reflection.height = b.height;
@@ -490,9 +490,9 @@
with(t)
{
a.opacity = b.opacity = 0;
- var r_part = new Clutter.CloneTexture({parent_texture:a});
- var g_part = new Clutter.CloneTexture({parent_texture:a});
- var b_part = new Clutter.CloneTexture({parent_texture:a});
+ var r_part = new Clutter.CloneTexture({parent_texture:a.parent_texture});
+ var g_part = new Clutter.CloneTexture({parent_texture:a.parent_texture});
+ var b_part = new Clutter.CloneTexture({parent_texture:a.parent_texture});
r_part.width = g_part.width = b_part.width = a.width;
r_part.height = g_part.height = b_part.height = a.height;
@@ -596,7 +596,7 @@
with(t)
{
a.opacity = b.opacity = 0;
- var blur = new Clutter.CloneTexture({parent_texture:a});
+ var blur = new Clutter.CloneTexture({parent_texture:a.parent_texture});
blur.width = a.width;
blur.height = a.height;
@@ -658,47 +658,5 @@
}
}
-function completed()
-{
- Seed.quit(0);
-}
-
-var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit()});
-stage.set_size(1024,768);
-stage.show_all();
-//stage.fullscreen = true;
-
-var black = new Clutter.Color();
-Clutter.color_parse("Black", black);
-stage.color = black;
-
-var begin = new Clutter.Texture.from_file("one.jpg");
-var end = new Clutter.Texture.from_file("two.jpg");
-
-with(begin)
-{
- filter_quality = Clutter.TextureQuality.High;
- width = stage.width;
- height = stage.height;
-}
-
-with(end)
-{
- filter_quality = Clutter.TextureQuality.High;
- width = stage.width;
- height = stage.height;
-}
-
-stage.add_actor(end);
-stage.add_actor(begin);
-
-GLib.timeout_add(500,
- function ()
- {
- doorway({a:begin, b:end, duration:3, done:completed, direction:d_out});
-
- return false;
- });
+transitions = [ fade, fly, push, reveal, move_in, drop, pivot, fall_out, scale, tiles_fly, tiles, tiles_across, doorway, color_planes, blur ];
-Clutter.main();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]