Esempio n. 1
0
 public void TransitionIn()
 {
     transitioning = true;
     VectorTransformation transitionTransformation =
         new VectorTransformation(new Vector2(textMenu.Position.X, 50), 1000);
     transitionTransformation.Complete += transitionTransformation_Complete;
     textMenu.TransformPosition(transitionTransformation);
     textMenu.TransformOpacity(new FloatTransformation(1f, 1000));
 }
Esempio n. 2
0
 public void TransitionOut()
 {
     transitioning = true;
     VectorTransformation transitionTransformation =
         new VectorTransformation(new Vector2(
             textMenu.Position.X, graphics.PresentationParameters.BackBufferHeight), 1000);
     FloatTransformation opacityTransformation = new FloatTransformation(0f, 1000);
     transitionTransformation.Complete += transitionExitTransformation_Complete;
     textMenu.TransformPosition(transitionTransformation);
     textMenu.TransformOpacity(opacityTransformation);
 }
Esempio n. 3
0
 private void TransformationFinished(object sender, TransformationCompleteArgs t)
 {
     if ((sender as VectorTransformation) != null)
         positionTransformation = null;
     else if ((sender as FloatTransformation) != null)
         opacityTransformation = null;
 }
Esempio n. 4
0
 /// <summary>
 /// Transforms the position of the object over time.
 /// </summary>
 /// <param name="transformation">The transformation</param>
 public void TransformPosition(VectorTransformation transformation)
 {
     transformation.Complete += TransformationFinished;
     positionTransformation = transformation;
 }