Ejemplo n.º 1
0
        /// <summary>
        ///  Verändert Hintergrund-Animations-Geschwindigkeit      0 = slower; 1 = normal; 2 = faster; 3 = ultrafast
        /// </summary>
        /// <param name="index"></param>
        public override void AnimationSpeed(enum_SpeedRatio SpeedRatio)
        {
            this.ActionQueue.Add(new Action(() =>
            {
                //SpeedRatio = enum_SpeedRatio.UltraFast;

                if (Enum.IsDefined(typeof(enum_SpeedRatio), SpeedRatio))
                {
                    this.MainWindow.BackgroundAnimation.ChangeAnimationSpeed(SpeedRatio);
                }
            }));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 0 = slower; 1 = normal; 2 = faster; 3 = ultrafast
        /// </summary>
        /// <param name="Key"></param>
        public void ChangeAnimationSpeed(enum_SpeedRatio SpeedRatio)
        {
            double SpeedFactor = 1;

            switch (SpeedRatio)
            {
            case enum_SpeedRatio.Slower:
                // slower
                //SpeedFactor = (double)1 / 0.7;
                SpeedFactor = 1;

                break;

            case enum_SpeedRatio.Normal:
                // normal
                Game.Config.ColorsAnimationTime = Config.ColorsAnimationTime_STANDARD;
                Game.Config.BlockAnimationTime  = Config.BlockAnimationTime_STANDARD;

                this.Window.SchlingernMargin = 10;

                break;

            case enum_SpeedRatio.Faster:
                //faster

                SpeedFactor = 1;


                break;

            case enum_SpeedRatio.UltraFast:

                SpeedFactor = (double)1 / 10;

                this.Window.SchlingernMargin = 20;

                break;

            case enum_SpeedRatio.Refresh:

                this.Window.SchlingernMargin = 10;
                break;

            default:
                break;
            }


            Game.Config.ColorsAnimationTime = TimeSpan.FromMilliseconds(Game.Config.ColorsAnimationTime.TotalMilliseconds * SpeedFactor);
            Game.Config.BlockAnimationTime  = TimeSpan.FromMilliseconds(Game.Config.BlockAnimationTime.TotalMilliseconds * SpeedFactor);
            this.Window.SchlingernDuration  = TimeSpan.FromMilliseconds(2000 * SpeedFactor);


            foreach (Storyboard s in this.Window.SchlingernStoryboards)
            {
                s.SetSpeedRatio(this.Window, (double)1 / SpeedFactor);
            }

            this.ColorStoryboard.SetSpeedRatio(this.containingElement, (double)1 / SpeedFactor);

            foreach (Storyboard s in this.BlockStoryboards)
            {
                s.SetSpeedRatio(this.containingElement, (double)1 / SpeedFactor);
            }
        }
Ejemplo n.º 3
0
        // virtual bedeutet, dass man zwar Code schreiben kann, und dass diese Methode überschrieben werden DARF


        public virtual void AnimationSpeed(enum_SpeedRatio SpeedRatio)
        {
        }