Exemplo n.º 1
0
 public BackAndForth(Vector2 initialPosition, Vector2 finalPosition, double lengthPerMovementInMilliseconds)
     : base(Constants.ViewEffectInfiniteLength)
 {
     LengthPerMovementInMilliseconds = lengthPerMovementInMilliseconds;
     InitialPosition = initialPosition;
     FinalPosition = finalPosition;
     InnerTranslateToEffect = new TranslateTo (InitialPosition, FinalPosition, LengthPerMovementInMilliseconds);
 }
Exemplo n.º 2
0
 protected override void UpdateEffect(GameTime gameTime, View view)
 {
     InnerTranslateToEffect.Update (gameTime, view);
     if (InnerTranslateToEffect.IsComplete ()) {
         if (IsMovingForth) {
             InnerTranslateToEffect = new TranslateTo (FinalPosition, InitialPosition, LengthPerMovementInMilliseconds);
         } else {
             InnerTranslateToEffect = new TranslateTo (InitialPosition, FinalPosition, LengthPerMovementInMilliseconds);
         }
         IsMovingForth = !IsMovingForth;
     }
 }
Exemplo n.º 3
0
 public virtual void Show()
 {
     PlayTransitionAudio ();
     Overlay.Appear ();
     Effects.TranslateTo translateToShownPosition = new Effects.TranslateTo (Position, ShowingPosition, TransitionMilliseconds);
     translateToShownPosition.OnComplete = HandleTranslatedtoShownPosition;
     StartEffect (translateToShownPosition);
     Visible = true;
 }
Exemplo n.º 4
0
 public virtual void Hide()
 {
     PlayTransitionAudio ();
     Overlay.Disappear ();
     Effects.TranslateTo translateToHiddenPosition = new Effects.TranslateTo (Position, HiddenPosition, TransitionMilliseconds);
     translateToHiddenPosition.OnComplete = HandleTranslatedtoHiddenPosition;
     StartEffect (translateToHiddenPosition);
 }