Esempio 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);
 }
Esempio 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;
     }
 }
Esempio 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;
 }
Esempio n. 4
0
 public virtual void Hide()
 {
     PlayTransitionAudio ();
     Overlay.Disappear ();
     Effects.TranslateTo translateToHiddenPosition = new Effects.TranslateTo (Position, HiddenPosition, TransitionMilliseconds);
     translateToHiddenPosition.OnComplete = HandleTranslatedtoHiddenPosition;
     StartEffect (translateToHiddenPosition);
 }