Exemple #1
0
        void GetSwingAnimationBackground(object obj)
        {
            AnimationThread    paramater  = (AnimationThread)obj;
            Rect               bound      = (Rect)(paramater.Paramaters[0]);
            int                swingTimes = (int)(paramater.Paramaters[1]);
            double             range      = (double)(paramater.Paramaters[2]);
            List <AnimationTo> jumps      = this.GetSwing(bound, range, swingTimes);

            Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                paramater.CompletedEvent(jumps);
            }));
        }
Exemple #2
0
        void GetShakeAnimationBackground(object obj)
        {
            AnimationThread    paramater   = (AnimationThread)obj;
            Rect               bound       = (Rect)(paramater.Paramaters[0]);
            int                shakeTimes  = (int)(paramater.Paramaters[1]);
            AOrientation       orientation = (AOrientation)(paramater.Paramaters[2]);
            List <AnimationTo> jumps       = this.GetShake(bound, orientation, shakeTimes);

            Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                paramater.CompletedEvent(jumps);
            }));
        }
Exemple #3
0
        void GetGoAnimationBackground(object obj)
        {
            AnimationThread    paramater   = (AnimationThread)obj;
            Rect               bound       = (Rect)(paramater.Paramaters[0]);
            Rect               screenBound = (Rect)(paramater.Paramaters[1]);
            ATowardto          toward      = (ATowardto)(paramater.Paramaters[2]);
            bool               stopInBound = (bool)(paramater.Paramaters[3]);
            List <AnimationTo> jumps       = this.GetGo(bound, screenBound, toward, stopInBound);

            Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                paramater.CompletedEvent(jumps);
            }));
        }
Exemple #4
0
        void GetFlashAnimationBackground(object obj)
        {
            AnimationThread paramater = (AnimationThread)obj;
            Rect            bound     = (Rect)(paramater.Paramaters[0]);

            int times = this.rand.Next(5, 200);

            List <AnimationTo> result = new List <AnimationTo>();

            for (int i = 0; i < times; i++)
            {
                AnimationTo at     = this.GetRandomPosition();
                Rect        posRec = new Rect(at.To.X, at.To.Y, bound.Width, bound.Height);
                result.Add(at);
                AnimationTo stay = new AnimationTo(this.rand.NextDouble() * 3, at.To);
                result.Add(stay);
            }

            Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                paramater.CompletedEvent(result);
            }));
        }