Пример #1
0
        protected override EffectTypeModuleData CreateInstanceForClone()
        {
            SnowflakesData result = new SnowflakesData
            {
                SnowflakeType        = SnowflakeType,
                FlakeCountCurve      = new Curve(FlakeCountCurve),
                Orientation          = Orientation,
                PointFlake45         = PointFlake45,
                LevelCurve           = new Curve(LevelCurve),
                InnerColor           = InnerColor.ToList(),
                OutSideColor         = OutSideColor.ToList(),
                ColorType            = ColorType,
                SpeedVariationCurve  = new Curve(SpeedVariationCurve),
                CenterSpeedCurve     = new Curve(CenterSpeedCurve),
                RandomBrightness     = RandomBrightness,
                MinDirection         = MinDirection,
                MaxDirection         = MaxDirection,
                SnowflakeEffect      = SnowflakeEffect,
                PixelCount           = PixelCount,
                SnowBuildUp          = SnowBuildUp,
                InitialBuildUp       = InitialBuildUp,
                BuildUpSpeedCurve    = new Curve(BuildUpSpeedCurve),
                XCenterSpeedCurve    = new Curve(XCenterSpeedCurve),
                YCenterSpeedCurve    = new Curve(YCenterSpeedCurve),
                XSpeedVariationCurve = new Curve(XSpeedVariationCurve),
                YSpeedVariationCurve = new Curve(YSpeedVariationCurve),
                SnowFlakeMovement    = SnowFlakeMovement,
                WobbleVariationCurve = new Curve(WobbleVariationCurve),
                WobbleCurve          = new Curve(WobbleCurve)
            };

            return(result);
        }
Пример #2
0
        protected override EffectTypeModuleData CreateInstanceForClone()
        {
            SnowflakesData result = new SnowflakesData
            {
                SnowflakeType    = SnowflakeType,
                Speed            = Speed,
                FlakeCount       = FlakeCount,
                Orientation      = Orientation,
                PointFlake45     = PointFlake45,
                LevelCurve       = new Curve(LevelCurve),
                InnerColor       = InnerColor.ToList(),
                OutSideColor     = OutSideColor.ToList(),
                ColorType        = ColorType,
                MaxSpeed         = MaxSpeed,
                MinSpeed         = MinSpeed,
                RandomBrightness = RandomBrightness,
                MinDirection     = MinDirection,
                MaxDirection     = MaxDirection,
                SnowflakeEffect  = SnowflakeEffect,
                PixelCount       = PixelCount,
                RandomSpeed      = RandomSpeed
            };

            return(result);
        }
        void Draw(RectangleF rect)
        {
            //// Color Declarations

            //// Frames
            var bgFrame = new RectangleF(0, 0, rect.Width, rect.Height);

            //// Subframes
            var circleGroup = new RectangleF(bgFrame.GetMinX() + (float)Math.Floor(bgFrame.Width * 0.13437f + 0.5f), bgFrame.GetMinY() + (float)Math.Floor(bgFrame.Height * 0.12500f + 0.5f), (float)Math.Floor(bgFrame.Width * 0.85938f + 0.5f) - (float)Math.Floor(bgFrame.Width * 0.13437f + 0.5f), (float)Math.Floor(bgFrame.Height * 0.84688f + 0.5f) - (float)Math.Floor(bgFrame.Height * 0.12500f + 0.5f));


            //// Abstracted Attributes
            var progressOvalEndAngle = Progress;

            //// circleGroup
            {
                //// outerOval Drawing
                var outerOvalPath = UIBezierPath.FromOval(new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.00216f) + 0.5f, circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.99784f) - (float)Math.Floor(circleGroup.Width * 0.00216f), (float)Math.Floor(circleGroup.Height * 1.00000f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f)));
                OuterColor.SetFill();
                outerOvalPath.Fill();

                //// progressOval Drawing
                var progressOvalRect = new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.00216f) + 0.5f, circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.99784f) - (float)Math.Floor(circleGroup.Width * 0.00216f), (float)Math.Floor(circleGroup.Height * 1.00000f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.00000f + 0.5f));
                var progressOvalPath = new UIBezierPath();
                progressOvalPath.AddArc(new PointF(progressOvalRect.GetMidX(), progressOvalRect.GetMidY()), progressOvalRect.Width / 2, (float)(270 * Math.PI / 180), (float)(progressOvalEndAngle * Math.PI / 180), true);
                progressOvalPath.AddLineTo(new PointF(progressOvalRect.GetMidX(), progressOvalRect.GetMidY()));
                progressOvalPath.ClosePath();

                InnerColor.SetFill();
                progressOvalPath.Fill();


                //// innerOval Drawing
                var innerOvalPath = UIBezierPath.FromOval(new RectangleF(circleGroup.GetMinX() + (float)Math.Floor(circleGroup.Width * 0.09052f + 0.5f), circleGroup.GetMinY() + (float)Math.Floor(circleGroup.Height * 0.09091f + 0.5f), (float)Math.Floor(circleGroup.Width * 0.90948f + 0.5f) - (float)Math.Floor(circleGroup.Width * 0.09052f + 0.5f), (float)Math.Floor(circleGroup.Height * 0.91342f + 0.5f) - (float)Math.Floor(circleGroup.Height * 0.09091f + 0.5f)));
                InsideColor.SetFill();
                innerOvalPath.Fill();
            }
        }