예제 #1
0
        public static EasingTypes GetReverseEasing(EasingTypes easing)
        {
            var s = easing.ToString();

            var contain_in  = s.Contains("In");
            var contain_out = s.Contains("Out");

            if (contain_in ^ contain_out)
            {
                var x = s;

                if (contain_in)
                {
                    x = x.Replace("In", "Out");
                }

                if (contain_out)
                {
                    x = x.Replace("Out", "In");
                }

                return(Enum.TryParse(x, out EasingTypes r) ? r : EasingTypes.None);
            }

            return(easing);
        }
예제 #2
0
        public virtual void moveY(EasingTypes easing, int startTime, int endTime, double startY, double endY)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
            {
                throw new CompilerException(-1, 315, easing.ToString());
            }
            var startParams = new[] { startY };
            var endParams   = new[] { endY };

            AddCommand(new Animation(AnimationType.MoveY, easing, startTime, endTime, startParams, endParams));
            this.y = (int)endY;
        }
예제 #3
0
        public virtual void rotate(EasingTypes easing, int startTime, int endTime, double startAngle, double endAngle)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
            {
                throw new CompilerException(-1, 315, easing.ToString());
            }
            var startParams = new[] { startAngle };
            var endParams   = new[] { endAngle };

            AddCommand(new Animation(AnimationType.Rotate, easing, startTime, endTime, startParams, endParams));
            rotation = endAngle;
        }
예제 #4
0
        public virtual void fade(EasingTypes easing, int startTime, int endTime, double startOpacity, double endOpacity)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
            {
                throw new CompilerException(-1, 315, easing.ToString());
            }
            var startParams = new[] { startOpacity };
            var endParams   = new[] { endOpacity };

            AddCommand(new Animation(AnimationType.Fade, easing, startTime, endTime, startParams, endParams));
            opacity = endOpacity;
        }
예제 #5
0
        public virtual void scaleVec(EasingTypes easing, int startTime, int endTime, double startX, double startY, double endX,
                                     double endY)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
            {
                throw new CompilerException(-1, 315, easing.ToString());
            }
            var startParams = new[] { startX, startY };
            var endParams   = new[] { endX, endY };

            AddCommand(new Animation(AnimationType.ScaleVec, easing, startTime, endTime, startParams, endParams));
            this.scaleFactor = (endX + endY) / 2;
        }
예제 #6
0
        public virtual void color(EasingTypes easing, int startTime, int endTime, int startRed, int startGreen, int startBlue,
                                  int endRed, int endGreen, int endBlue)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
            {
                throw new CompilerException(-1, 315, easing.ToString());
            }
            var startParams = new double[] { startRed, startGreen, startBlue };
            var endParams   = new double[] { endRed, endGreen, endBlue };

            AddCommand(new Animation(AnimationType.Color, easing, startTime, endTime, startParams, endParams));
            red   = endRed;
            green = endGreen;
            blue  = endBlue;
        }
        public virtual void scaleVec(EasingTypes easing, int startTime, int endTime, double startX, double startY, double endX,
							 double endY)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
                throw new CompilerException(-1, 315, easing.ToString());
            var startParams = new[] { startX, startY };
            var endParams = new[] { endX, endY };
            AddCommand(new Animation(AnimationType.ScaleVec, easing, startTime, endTime, startParams, endParams));
            this.scaleFactor = (endX + endY) / 2;
        }
 public virtual void rotate(EasingTypes easing, int startTime, int endTime, double startAngle, double endAngle)
 {
     if (!Enum.IsDefined(typeof(EasingTypes), easing))
         throw new CompilerException(-1, 315, easing.ToString());
     var startParams = new[] { startAngle };
     var endParams = new[] { endAngle };
     AddCommand(new Animation(AnimationType.Rotate, easing, startTime, endTime, startParams, endParams));
     rotation = endAngle;
 }
 public virtual void moveY(EasingTypes easing, int startTime, int endTime, double startY, double endY)
 {
     if (!Enum.IsDefined(typeof(EasingTypes), easing))
         throw new CompilerException(-1, 315, easing.ToString());
     var startParams = new[] { startY };
     var endParams = new[] { endY };
     AddCommand(new Animation(AnimationType.MoveY, easing, startTime, endTime, startParams, endParams));
     this.y = (int)endY;
 }
 public virtual void fade(EasingTypes easing, int startTime, int endTime, double startOpacity, double endOpacity)
 {
     if (!Enum.IsDefined(typeof(EasingTypes), easing))
         throw new CompilerException(-1, 315, easing.ToString());
     var startParams = new[] { startOpacity };
     var endParams = new[] { endOpacity };
     AddCommand(new Animation(AnimationType.Fade, easing, startTime, endTime, startParams, endParams));
     opacity = endOpacity;
 }
        public virtual void color(EasingTypes easing, int startTime, int endTime, int startRed, int startGreen, int startBlue,
						  int endRed, int endGreen, int endBlue)
        {
            if (!Enum.IsDefined(typeof(EasingTypes), easing))
                throw new CompilerException(-1, 315, easing.ToString());
            var startParams = new double[] { startRed, startGreen, startBlue };
            var endParams = new double[] { endRed, endGreen, endBlue };
            AddCommand(new Animation(AnimationType.Color, easing, startTime, endTime, startParams, endParams));
            red = endRed;
            green = endGreen;
            blue = endBlue;
        }