[ease] Started working on the "Slats" transition.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] Started working on the "Slats" transition.
- Date: Thu, 20 May 2010 09:31:34 +0000 (UTC)
commit 2bd3d04e4d6f7f76067f48b7257957a4ca9f0f3d
Author: Nate Stedman <natesm gmail com>
Date: Thu May 20 05:22:43 2010 -0400
Started working on the "Slats" transition.
Examples/Transitions.ease/Document.xml | 5 ++
src/libease/SlideActor.vala | 72 ++++++++++++++++++++++++++++++++
src/libease/Transitions.vala | 1 +
3 files changed, 78 insertions(+), 0 deletions(-)
---
diff --git a/Examples/Transitions.ease/Document.xml b/Examples/Transitions.ease/Document.xml
index db7ccd1..87dc93c 100644
--- a/Examples/Transitions.ease/Document.xml
+++ b/Examples/Transitions.ease/Document.xml
@@ -1,6 +1,11 @@
<?xml version="1.0" ?>
<document width="1024" height="768">
<slides>
+ <slide transition="Slats" variant="" background_color="#222222FF" time="5">
+ <element y="30" align="left" height="200" font_size="36" element_type="text" font_variant="Normal" font_name="Sans" width="964" font_style="Normal" font_weight="900" color="#FFFFFFFF" x="30" ease_name="header" >Lorem Ipsum Dolor</element>
+ <element y="90" align="left" height="768" font_size="16" element_type="text" font_variant="Normal" font_name="Sans" width="964" font_style="Normal" font_weight="500" color="#FFFFFFFF" x="30" ease_name="text" >Sit amet, consectetur adipiscing elit. Maecenas sed odio eget purus laoreet volutpat. Etiam nulla orci, eleifend nec sodales in, tempor cursus urna. Aenean posuere aliquet malesuada. Integer varius placerat massa. Pellentesque enim urna, cursus et molestie et, iaculis vitae libero. Quisque vel metus sed magna lacinia luctus. Suspendisse vel lectus eget diam dapibus condimentum. Aliquam a dolor vel sem rutrum mattis sit amet vitae nisl. Etiam vel sem tortor. Vestibulum varius metus id orci vulputate viverra luctus magna commodo. Duis dignissim sollicitudin leo eget tristique. Maecenas adipiscing neque nec mauris mollis ut ultrices sem porta. Cras vitae massa lectus. Aenean orci lectus, pretium nec sodales eu, aliquam vitae neque. Mauris nibh lectus, porta et vestibulu
m a, vestibulum a nulla.</element>
+ </slide>
+
<slide transition="Reveal" variant="Top" background_color="#FFFFFFFF" time="1">
<element y="30" align="left" height="200" font_size="36" element_type="text" font_variant="Normal" font_name="Sans" width="964" font_style="Normal" font_weight="900" color="#222222FF" x="30" ease_name="header" >Lorem Ipsum Dolor</element>
<element y="90" align="left" height="768" font_size="16" element_type="text" font_variant="Normal" font_name="Sans" width="964" font_style="Normal" font_weight="500" color="#222222FF" x="30" ease_name="text" >Sit amet, consectetur adipiscing elit. Maecenas sed odio eget purus laoreet volutpat. Etiam nulla orci, eleifend nec sodales in, tempor cursus urna. Aenean posuere aliquet malesuada. Integer varius placerat massa. Pellentesque enim urna, cursus et molestie et, iaculis vitae libero. Quisque vel metus sed magna lacinia luctus. Suspendisse vel lectus eget diam dapibus condimentum. Aliquam a dolor vel sem rutrum mattis sit amet vitae nisl. Etiam vel sem tortor. Vestibulum varius metus id orci vulputate viverra luctus magna commodo. Duis dignissim sollicitudin leo eget tristique. Maecenas adipiscing neque nec mauris mollis ut ultrices sem porta. Cras vitae massa lectus. Aenean orci lectus, pretium nec sodales eu, aliquam vitae neque. Mauris nibh lectus, porta et vestibulu
m a, vestibulum a nulla.</element>
diff --git a/src/libease/SlideActor.vala b/src/libease/SlideActor.vala
index 0282fa7..05dc06d 100644
--- a/src/libease/SlideActor.vala
+++ b/src/libease/SlideActor.vala
@@ -62,6 +62,7 @@ public class Ease.SlideActor : Clutter.Group
private const float OPEN_DEPTH = -3000;
private const float OPEN_MOVE = 0.15f;
private const float OPEN_TIME = 0.8f;
+ private const int SLAT_COUNT = 8;
public SlideActor.from_slide(Document document, Slide s, bool clip,
ActorContext ctx)
@@ -358,6 +359,77 @@ public class Ease.SlideActor : Clutter.Group
break;
}
break;
+
+ case "Slats":
+ {
+ // hide the real SlideActors
+ reparent(stack_container);
+ new_slide.reparent(stack_container);
+ x = slide.parent.width;
+ new_slide.x = slide.parent.width;
+
+ // make arrays for the slats
+ var this_slats = new Clutter.Clone[SLAT_COUNT];
+ var new_slats = new Clutter.Clone[SLAT_COUNT];
+ var groups = new Clutter.Group[SLAT_COUNT];
+
+ // calculate the width of each slat
+ float width = (float)slide.parent.width / SLAT_COUNT;
+
+ // make the slats
+ for (int i = 0; i < SLAT_COUNT; i++)
+ {
+ // create groups
+ groups[i] = new Clutter.Group();
+ stack_container.add_actor(groups[i]);
+
+ // create clones
+ this_slats[i] = new Clutter.Clone(this);
+ groups[i].add_actor(this_slats[i]);
+ new_slats[i] = new Clutter.Clone(new_slide);
+ groups[i].add_actor(new_slats[i]);
+
+ // clip clones
+ this_slats[i].set_clip(width * i, 0,
+ width, slide.parent.height);
+ new_slats[i].set_clip(width * i, 0,
+ width, slide.parent.height);
+
+ // flip the back slats
+ new_slats[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
+ 180, (i + 0) * angle, 0, 0);
+
+ // place the new slats behind the current ones
+ new_slats[i].depth = -1;
+ }
+
+ // make an alpha for easing
+ animation_alpha = new Clutter.Alpha.full(animation_time,
+ Clutter.AnimationMode.EASE_IN_OUT_BACK);
+
+ // animate
+ animation_time.new_frame.connect((m) => {
+ for (int i = 0; i < SLAT_COUNT; i++)
+ {
+ groups[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
+ 180 * animation_alpha.get_alpha(),
+ (i + 0.5f) * width, 0, 0);
+ }
+ });
+
+ animation_time.completed.connect(() => {
+ // clean up the slats
+ for (int i = 0; i < SLAT_COUNT; i++)
+ {
+ stack_container.remove_actor(groups[i]);
+ }
+
+ // put the new slide in place
+ new_slide.x = 0;
+ });
+
+ break;
+ }
case "Flip":
new_slide.opacity = 0;
diff --git a/src/libease/Transitions.vala b/src/libease/Transitions.vala
index bf3d878..a310291 100644
--- a/src/libease/Transitions.vala
+++ b/src/libease/Transitions.vala
@@ -44,6 +44,7 @@ public static class Ease.Transitions : GLib.Object
add_transition("Revolving Door", { "Top", "Bottom", "Left", "Right" }, 4);
add_transition("Reveal", { "Top", "Bottom", "Left", "Right" }, 4);
add_transition("Fall", {}, 0);
+ add_transition("Slats", {}, 0);
add_transition("Open Door", {}, 0);
add_transition("Zoom", { "Center", "Top Left", "Top Right", "Bottom Left", "Bottom Right" }, 5);
add_transition("Panel", { "Up", "Down", "Left", "Right" }, 4);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]