Esempio n. 1
0
        /// <summary>
        /// Adding dying animation for each Invader object.
        /// </summary>
        private static void addDyingAnimation()
        {
            /// Dying animation for enemies
            SpinAnimation     spinAnimationForEnemies   = new SpinAnimation("Spin", sr_dyingTimeForEnemies, sr_dyingSpinsForEnemies, sr_commonOrigin);
            ShrinkAnimation   shrinkAnimationForEnemies = new ShrinkAnimation("Shrink", sr_dyingTimeForEnemies);
            AnimationsLibrary enemyDyingAnimation       = new AnimationsLibrary("Enemy Dying", sr_dyingTimeForEnemies);

            enemyDyingAnimation.AddAnimation(spinAnimationForEnemies, shrinkAnimationForEnemies);
            s_animationsManager.AddAnimationToManager(enemyDyingAnimation);
            /// Attacked animation for spaceships
            bool              v_FinalVisibility           = true;
            BlinkAnimation    blinkAnimationForSpaceships = new BlinkAnimation("Blink", sr_attackedTimeForSpaceships, sr_attackedBlinksForSpaceships, v_FinalVisibility);
            AnimationsLibrary spaceshipAttackedAnimation  = new AnimationsLibrary("Spaceship Attacked", sr_attackedTimeForSpaceships);

            spaceshipAttackedAnimation.AddAnimation(blinkAnimationForSpaceships);
            s_animationsManager.AddAnimationToManager(spaceshipAttackedAnimation);
            /// Dying animation for spaceships
            SpinAnimation     spinAnimationForSpaceships   = new SpinAnimation("Spin", sr_dyingTimeForSpaceships, sr_dyingSpinsForSpaceships, sr_commonOrigin);
            FadeOutAnimation  fadeOutAnimationForSpaceship = new FadeOutAnimation("Fade Out", sr_dyingTimeForSpaceships);
            AnimationsLibrary spaceshipDyingAnimation      = new AnimationsLibrary("Spaceship Dying", sr_dyingTimeForSpaceships);

            spaceshipDyingAnimation.AddAnimation(spinAnimationForSpaceships, fadeOutAnimationForSpaceship);
            s_animationsManager.AddAnimationToManager(spaceshipDyingAnimation);
            /// Attacked animation for motherships
            ShrinkAnimation   shrinkAnimationForMotherships = new ShrinkAnimation("Shrink", sr_attackedTimeForMotherships);
            BlinkAnimation    blinkAnimationForMotherships  = new BlinkAnimation("Blink", sr_attackedTimeForMotherships, sr_attackedBlinksForMotherships);
            FadeOutAnimation  fadeOutAnimationForMothership = new FadeOutAnimation("Fade Out", sr_attackedTimeForMotherships);
            AnimationsLibrary mothershipDyingAnimation      = new AnimationsLibrary("Mothership Attacked", sr_attackedTimeForMotherships);

            mothershipDyingAnimation.AddAnimation(shrinkAnimationForMotherships, blinkAnimationForMotherships, fadeOutAnimationForMothership);
            s_animationsManager.AddAnimationToManager(mothershipDyingAnimation);
        }
Esempio n. 2
0
        public ProgressScan()
        {
            InitializeComponent();
            storyboardIndicator.CurrentTimeInvalidated += storyboardIndicator_CurrentTimeInvalidated;
            storyboardIndicator.Completed += storyboardIndicator_Completed;

            bool   dataContextInitialized = false;
            object locker = new object();

            this.DataContextChanged += (o, e) =>
            {
                lock (locker)
                {
                    if (!dataContextInitialized)
                    {
                        if (ViewModel != null)
                        {
                            dataContextInitialized  = true;
                            ViewModel.OnCloseEvent += () =>
                            {
                                FadeOutAnimation.Completed -= OnFadeOutAnimationCompleted;
                                FadeOutAnimation.Stop();

                                storyboardIndicator.CurrentTimeInvalidated -= storyboardIndicator_CurrentTimeInvalidated;
                                storyboardIndicator.Completed -= storyboardIndicator_Completed;
                                storyboardIndicator.Stop();
                            };
                        }
                    }
                }
            };
        }
 protected override void onNewWindowGaze(IntPtr window)
 {
     showWindow(this.currentlyActiveWindow);
     if (this.runningAnimations.ContainsKey(window))
     {
         FadeOutAnimation animation = this.runningAnimations[window];
         if (animation != null)
         {
             animation.stop();
         }
     }
 }
        private void startAnimation(IntPtr window, string processName)
        {
            this.visibleWindows.Remove(window);
            FadeOutAnimation animation = new FadeOutAnimation(window, processName, () => {
                log.debug("stop callback invoked for window owned by: {0}", processName);
                this.runningAnimations.Remove(window);
                this.visibleWindows.Remove(window);
                return(true);
            });

            this.runningAnimations[window] = animation;
            log.debug("hiding window owned by process {0} with animation", processName);
            animation.start();
        }
        // Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
        async void DismissedEventHandler(SplashScreen sender, object e)
        {
            // Navigate away from the app's extended splash screen after completing setup operations here...
            // This sample navigates away from the extended splash screen when the "Learn More" button is clicked.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async delegate()
            {
                //await Task.Delay(5000);
                var mainPage = new MainPage();
                await mainPage.OnLoaded(_loadState, true);

                StatisticsManager.SendStatisticsToServer();

                FadeOutAnimation.Begin();
                FadeOutAnimation.Completed += delegate {
                    if (Window.Current.Content == this)
                    {
                        Window.Current.Content = mainPage;
                    }
                };
            });
        }
Esempio n. 6
0
        /// <summary>
        /// Clones all the animations provided to this animator, so the original
        /// scriptable objects don't get changed.
        /// </summary>
        private void CloneAnimations()
        {
            if (moveInAnimation != null)
            {
                moveInAnimation = Instantiate(moveInAnimation) as MoveInAnimation;
            }

            if (moveOutAnimation != null)
            {
                moveOutAnimation = Instantiate(moveOutAnimation) as MoveOutAnimation;
            }

            if (movePingPongAnimation != null)
            {
                movePingPongAnimation = Instantiate(movePingPongAnimation) as MovePingPongAnimation;
            }

            if (rotateInAnimation != null)
            {
                rotateInAnimation = Instantiate(rotateInAnimation) as RotateInAnimation;
            }

            if (rotateOutAnimation != null)
            {
                rotateOutAnimation = Instantiate(rotateOutAnimation) as RotateOutAnimation;
            }

            if (rotatePingPongAnimation != null)
            {
                rotatePingPongAnimation = Instantiate(rotatePingPongAnimation) as RotatePingPongAnimation;
            }

            if (scaleInAnimation != null)
            {
                scaleInAnimation = Instantiate(scaleInAnimation) as ScaleInAnimation;
            }

            if (scaleOutAnimation != null)
            {
                scaleOutAnimation = Instantiate(scaleOutAnimation) as ScaleOutAnimation;
            }

            if (scalePingPongAnimation != null)
            {
                scalePingPongAnimation = Instantiate(scalePingPongAnimation) as ScalePingPongAnimation;
            }

            if (fadeInAnimation != null)
            {
                fadeInAnimation = Instantiate(fadeInAnimation) as FadeInAnimation;
            }

            if (fadeOutAnimation != null)
            {
                fadeOutAnimation = Instantiate(fadeOutAnimation) as FadeOutAnimation;
            }

            if (fadePingPongAnimation != null)
            {
                fadePingPongAnimation = Instantiate(fadePingPongAnimation) as FadePingPongAnimation;
            }
        }
        private static AnimationDefinition GetAnimationDefinition(string animationName)
        {
            AnimationDefinition animationDefinition = null;

            if (animationName != null)
            {
                switch (animationName.ToLower())
                {
                case "flash": animationDefinition = new FlashAnimation(); break;

                case "bounce": animationDefinition = new BounceAnimation(); break;

                case "shake": animationDefinition = new ShakeAnimation(); break;

                case "tada": animationDefinition = new TadaAnimation(); break;

                case "swing": animationDefinition = new SwingAnimation(); break;

                case "wobble": animationDefinition = new WobbleAnimation(); break;

                case "pulse": animationDefinition = new PulseAnimation(); break;

                case "breathing": animationDefinition = new BreathingAnimation(); break;

                case "jump": animationDefinition = new JumpAnimation(); break;

                case "flip": animationDefinition = new FlipAnimation(); break;

                case "flipinx": animationDefinition = new FlipInXAnimation(); break;

                case "flipoutx": animationDefinition = new FlipOutXAnimation(); break;

                case "flipiny": animationDefinition = new FlipInYAnimation(); break;

                case "flipouty": animationDefinition = new FlipOutYAnimation(); break;

                case "fadein": animationDefinition = new FadeInAnimation(); break;

                case "fadeout": animationDefinition = new FadeOutAnimation(); break;

                case "fadeinleft": animationDefinition = new FadeInLeftAnimation(); break;

                case "fadeinright": animationDefinition = new FadeInRightAnimation(); break;

                case "fadeinup": animationDefinition = new FadeInUpAnimation(); break;

                case "fadeindown": animationDefinition = new FadeInDownAnimation(); break;

                case "fadeoutleft": animationDefinition = new FadeOutLeftAnimation(); break;

                case "fadeoutright": animationDefinition = new FadeOutRightAnimation(); break;

                case "fadeoutup": animationDefinition = new FadeOutUpAnimation(); break;

                case "fadeoutdown": animationDefinition = new FadeOutDownAnimation(); break;

                case "bouncein": animationDefinition = new BounceInAnimation(); break;

                case "bounceout": animationDefinition = new BounceOutAnimation(); break;

                case "bounceinleft": animationDefinition = new BounceInLeftAnimation(); break;

                case "bounceinright": animationDefinition = new BounceInRightAnimation(); break;

                case "bounceinup": animationDefinition = new BounceInUpAnimation(); break;

                case "bounceindown": animationDefinition = new BounceInDownAnimation(); break;

                case "bounceoutleft": animationDefinition = new BounceOutLeftAnimation(); break;

                case "bounceoutright": animationDefinition = new BounceOutRightAnimation(); break;

                case "bounceoutup": animationDefinition = new BounceOutUpAnimation(); break;

                case "bounceoutdown": animationDefinition = new BounceOutDownAnimation(); break;

                case "scalein": animationDefinition = new ScaleInAnimation(); break;

                case "scaleout": animationDefinition = new ScaleOutAnimation(); break;

                case "lightspeedinleft": animationDefinition = new LightSpeedInLeftAnimation(); break;

                case "lightspeedinright": animationDefinition = new LightSpeedInRightAnimation(); break;

                case "lightspeedoutleft": animationDefinition = new LightSpeedOutLeftAnimation(); break;

                case "lightspeedoutright": animationDefinition = new LightSpeedOutRightAnimation(); break;

                case "hinge": animationDefinition = new HingeAnimation(); break;

                case "reset": animationDefinition = new ResetAnimation(); break;
                }
            }
            return(animationDefinition);
        }
        private void SwitchImage()
        {
            currentIndex = (currentIndex + 1) % files.Count;

            FadeOutAnimation.Begin();
        }
Esempio n. 9
0
 public override void StopAnimations()
 {
     base.StopAnimations();
     FadeInAnimation.Stop();
     FadeOutAnimation.Stop();
 }
Esempio n. 10
0
 public void Hide()
 {
     FadeOutAnimation.Begin();
     UIAnimationHelper.FadeOut(this);
 }