[ease] Added "Reveal" transition, with 4 variants.



commit 5e84d94351dfde0e184e344441119da4140d5797
Author: Nate Stedman <natesm gmail com>
Date:   Thu May 20 04:21:54 2010 -0400

    Added "Reveal" transition, with 4 variants.

 Examples/Transitions.ease/Document.xml |    5 +++++
 src/libease/Player.vala                |    3 ++-
 src/libease/SlideActor.vala            |   31 ++++++++++++++++++++++++++++++-
 src/libease/Transitions.vala           |    1 +
 4 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/Examples/Transitions.ease/Document.xml b/Examples/Transitions.ease/Document.xml
index feb57c6..db7ccd1 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="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>
+		</slide>
+	
 		<slide transition="Fade" variant="" background_color="#222222FF" 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="#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>
diff --git a/src/libease/Player.vala b/src/libease/Player.vala
index 6ec4d3e..40f5388 100644
--- a/src/libease/Player.vala
+++ b/src/libease/Player.vala
@@ -117,16 +117,17 @@ public class Ease.Player : GLib.Object
 			current_slide.opacity = 0;
 			current_slide.animate(Clutter.AnimationMode.EASE_IN_SINE,
 			                      1000, "opacity", 255);
+			stage.add_actor(current_slide);
 		}
 		else
 		{			
 			old_slide = current_slide;
 			create_current_slide(slide);
+			stage.add_actor(current_slide);
 			old_slide.transition(current_slide, stack_container);
 			old_slide.animation_time.completed.connect(animation_complete);
 			can_animate = false;
 		}
-		stage.add_actor(current_slide);
 	}
 	
 	private void retreat()
diff --git a/src/libease/SlideActor.vala b/src/libease/SlideActor.vala
index c9f07a6..0282fa7 100644
--- a/src/libease/SlideActor.vala
+++ b/src/libease/SlideActor.vala
@@ -232,7 +232,7 @@ public class Ease.SlideActor : Clutter.Group
 					case "Left":
 						new_slide.x = slide.parent.width;
 						new_slide.animate(EASE_SLIDE, length, "x", 0);
-						this.animate(EASE_SLIDE, length, "x", -new_slide.x);
+						animate(EASE_SLIDE, length, "x", -new_slide.x);
 						break;
 					case "Right":
 						new_slide.x = -slide.parent.width;
@@ -330,6 +330,35 @@ public class Ease.SlideActor : Clutter.Group
 				break;
 			}
 			
+			case "Reveal":
+				// TODO: make this transition not a total hack
+				((Clutter.Container)get_parent()).raise_child(this, new_slide);
+				
+				switch (slide.variant)
+				{
+					case "Top":
+						new_slide.y = slide.parent.height;
+						animate(EASE_SLIDE, length, "y", -new_slide.y);
+						new_slide.y = 0;
+						break;
+					case "Bottom":
+						new_slide.y = -slide.parent.height;
+						animate(EASE_SLIDE, length, "y", -new_slide.y);
+						new_slide.y = 0;
+						break;
+					case "Left":
+						new_slide.x = slide.parent.width;
+						this.animate(EASE_SLIDE, length, "x", -new_slide.x);
+						new_slide.x = 0;
+						break;
+					case "Right":
+						new_slide.x = -slide.parent.width;
+						animate(EASE_SLIDE, length, "x", -new_slide.x);
+						new_slide.x = 0;
+						break;
+				}
+				break;
+			
 			case "Flip":
 				new_slide.opacity = 0;				
 				time1 = new Clutter.Timeline(length / 2);
diff --git a/src/libease/Transitions.vala b/src/libease/Transitions.vala
index 7e0dfa5..bf3d878 100644
--- a/src/libease/Transitions.vala
+++ b/src/libease/Transitions.vala
@@ -42,6 +42,7 @@ public static class Ease.Transitions : GLib.Object
 		add_transition("Pivot", { "Top Left", "Top Right", "Bottom Left", "Bottom Right" }, 4);
 		add_transition("Flip", { "Top to Bottom", "Bottom to Top", "Left to Right", "Right to Left" }, 4);
 		add_transition("Revolving Door", { "Top", "Bottom", "Left", "Right" }, 4);
+		add_transition("Reveal", { "Top", "Bottom", "Left", "Right" }, 4);
 		add_transition("Fall", {}, 0);
 		add_transition("Open Door", {}, 0);
 		add_transition("Zoom", { "Center", "Top Left", "Top Right", "Bottom Left", "Bottom Right" }, 5);



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