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)); }
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); }
private void TransformationFinished(object sender, TransformationCompleteArgs t) { if ((sender as VectorTransformation) != null) positionTransformation = null; else if ((sender as FloatTransformation) != null) opacityTransformation = null; }
/// <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; }