Example #1
0
 public WaitSprite(int s, int w, int h)
 {
     this.style = s;
     this.wait = new WaitSprite.DrawWait(s, w, h);
     this.delay = new LTimer(120);
     this.alpha = 1.0F;
     this.visible = true;
     if (s > 1)
     {
         int width_0 = w / 2;
         int height_1 = h / 2;
         cycle = NewSample(s - 2, width_0, height_1);
         RectBox limit = cycle.GetCollisionBox();
         SetLocation(
                 (w - ((limit.GetWidth() == 0) ? (float)(20) : (float)(limit.GetWidth()))) / 2,
                 (h - ((limit.GetHeight() == 0) ? (float)(20) : (float)(limit.GetHeight()))) / 2);
     }
     Update(0);
 }
Example #2
0
        public static Cycle GetSample(int type, float srcWidth,
                float srcHeight, float width, float height, float offset,
                int padding)
        {
            Cycle cycle = new Cycle();
            float s = 1;
            if (srcWidth > srcHeight)
            {
                s = MathUtils.Max(srcWidth / width, srcHeight / height);
            }
            else
            {
                s = MathUtils.Min(srcWidth / width, srcHeight / height);
            }
            float scale = s;
            switch (type)
            {
                case 0:
                    cycle = new Cycle._Anonymous(scale);
                    cycle.SetLineWidth(5);
                    cycle.SetDelay(45);
                    cycle.SetColor(0xFF2E82);
                    cycle.SetStepType(4);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.05f);
                    cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360);
                    break;
                case 1:
                    cycle.SetColor(0xFF7B24);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.10f);
                    cycle.SetMultiplier(2);
                    cycle.AddPath(Cycle.ARC, 10 * scale, 10 * scale, 10 * scale, -270,
                            -90);
                    cycle.AddPath(Cycle.BEZIER, 10 * scale, 0 * scale, 40 * scale,
                            20 * scale, 20 * scale, 0, 30 * scale, 20 * scale);
                    cycle.AddPath(Cycle.ARC, 40 * scale, 10 * scale, 10 * scale, 90,
                            -90);
                    cycle.AddPath(Cycle.BEZIER, 40 * scale, 0 * scale, 10 * scale,
                            20 * scale, 30 * scale, 0, 20 * scale, 20 * scale);
                    break;
                case 2:
                    cycle.SetColor(0xD4FF00);
                    cycle.SetStepType(1);
                    cycle.SetDelay(55);
                    cycle.SetStepsPerFrame(2);
                    cycle.SetTrailLength(0.3f);
                    cycle.SetPointDistance(0.1f);
                    cycle.AddPath(Cycle.LINE, 0, 0, 30 * scale, 0);
                    cycle.AddPath(Cycle.LINE, 30 * scale, 0 * scale, 30 * scale,
                            30 * scale);
                    cycle.AddPath(Cycle.LINE, 30 * scale, 30 * scale, 0, 30 * scale);
                    cycle.AddPath(Cycle.LINE, 0, 30 * scale, 0, 0);
                    break;
                case 3:

                    cycle = new Cycle.Anonymous_C0(scale);
                    cycle.SetColor(0x05E2FF);
                    cycle.SetLineWidth(2);
                    cycle.SetStepType(4);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.025f);
                    cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360);
                    break;
                case 4:
                    cycle.SetColor(0xFFA50000);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.025f);
                    cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 40 * scale, 0, 360);
                    break;
                case 5:
                    cycle.SetColor(0xFF2E82);
                    cycle.SetDelay(60);
                    cycle.SetStepType(1);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.1f);
                    cycle.AddPath(Cycle.LINE, 0, 20 * scale, 100 * scale, 20 * scale);
                    cycle.AddPath(Cycle.LINE, 100 * scale, 20 * scale, 0, 20 * scale);
                    break;
                case 6:
                    cycle.SetStepsPerFrame(7);
                    cycle.SetTrailLength(0.7f);
                    cycle.SetPointDistance(0.01f);
                    cycle.SetDelay(35);
                    cycle.SetLineWidth(10);
                    cycle.AddPath(Cycle.LINE, 20 * scale, 70 * scale, 50 * scale,
                            20 * scale);
                    cycle.AddPath(Cycle.LINE, 50 * scale, 20 * scale, 80 * scale,
                            70 * scale);
                    cycle.AddPath(Cycle.LINE, 80 * scale, 70 * scale, 20 * scale,
                            70 * scale);
                    break;
                case 7:
                    cycle.SetColor(0xD4FF00);
                    cycle.SetStepsPerFrame(3);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.01f);
                    cycle.SetLineWidth(6);
                    cycle.SetPadding(0);
                    cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 20 * scale, 360, 0);
                    break;
                case 8:
                    cycle.SetColor(0x05E2FF);
                    cycle.SetStepsPerFrame(1);
                    cycle.SetTrailLength(1);
                    cycle.SetPointDistance(0.02f);
                    cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 30 * scale, 0, 360);
                    break;
                case 9:
                    cycle.SetStepType(1);
                    cycle.SetColor(LColor.yellow);
                    cycle.AddPath(Cycle.LINE, 10 * scale, 10 * scale, 90 * scale,
                            10 * scale);
                    cycle.AddPath(Cycle.LINE, 90 * scale, 10 * scale, 90 * scale,
                            90 * scale);
                    cycle.AddPath(Cycle.LINE, 90 * scale, 90 * scale, 10 * scale,
                            90 * scale);
                    cycle.AddPath(Cycle.LINE, 10 * scale, 90 * scale, 10 * scale,
                            10 * scale);
                    break;
            }
            float size = MathUtils.Min(srcWidth / (1 / cycle.GetPointDistance()),
                    srcHeight / (1 / cycle.GetPointDistance()));
            cycle.SetPadding(padding);
            cycle.SetBlockWidth(size + offset);
            cycle.SetBlockHeight(size + offset);
            cycle.SetWidth(width * scale);
            cycle.SetHeight(height * scale);
            return cycle;
        }
Example #3
0
        public static Cycle GetSample(int type, float srcWidth,
                                      float srcHeight, float width, float height, float offset,
                                      int padding)
        {
            Cycle cycle = new Cycle();
            float s     = 1;

            if (srcWidth > srcHeight)
            {
                s = MathUtils.Max(srcWidth / width, srcHeight / height);
            }
            else
            {
                s = MathUtils.Min(srcWidth / width, srcHeight / height);
            }
            float scale = s;

            switch (type)
            {
            case 0:
                cycle = new Cycle._Anonymous(scale);
                cycle.SetLineWidth(5);
                cycle.SetDelay(45);
                cycle.SetColor(0xFF2E82);
                cycle.SetStepType(4);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.05f);
                cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360);
                break;

            case 1:
                cycle.SetColor(0xFF7B24);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.10f);
                cycle.SetMultiplier(2);
                cycle.AddPath(Cycle.ARC, 10 * scale, 10 * scale, 10 * scale, -270,
                              -90);
                cycle.AddPath(Cycle.BEZIER, 10 * scale, 0 * scale, 40 * scale,
                              20 * scale, 20 * scale, 0, 30 * scale, 20 * scale);
                cycle.AddPath(Cycle.ARC, 40 * scale, 10 * scale, 10 * scale, 90,
                              -90);
                cycle.AddPath(Cycle.BEZIER, 40 * scale, 0 * scale, 10 * scale,
                              20 * scale, 30 * scale, 0, 20 * scale, 20 * scale);
                break;

            case 2:
                cycle.SetColor(0xD4FF00);
                cycle.SetStepType(1);
                cycle.SetDelay(55);
                cycle.SetStepsPerFrame(2);
                cycle.SetTrailLength(0.3f);
                cycle.SetPointDistance(0.1f);
                cycle.AddPath(Cycle.LINE, 0, 0, 30 * scale, 0);
                cycle.AddPath(Cycle.LINE, 30 * scale, 0 * scale, 30 * scale,
                              30 * scale);
                cycle.AddPath(Cycle.LINE, 30 * scale, 30 * scale, 0, 30 * scale);
                cycle.AddPath(Cycle.LINE, 0, 30 * scale, 0, 0);
                break;

            case 3:

                cycle = new Cycle.Anonymous_C0(scale);
                cycle.SetColor(0x05E2FF);
                cycle.SetLineWidth(2);
                cycle.SetStepType(4);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.025f);
                cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360);
                break;

            case 4:
                cycle.SetColor(0xFFA50000);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.025f);
                cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 40 * scale, 0, 360);
                break;

            case 5:
                cycle.SetColor(0xFF2E82);
                cycle.SetDelay(60);
                cycle.SetStepType(1);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.1f);
                cycle.AddPath(Cycle.LINE, 0, 20 * scale, 100 * scale, 20 * scale);
                cycle.AddPath(Cycle.LINE, 100 * scale, 20 * scale, 0, 20 * scale);
                break;

            case 6:
                cycle.SetStepsPerFrame(7);
                cycle.SetTrailLength(0.7f);
                cycle.SetPointDistance(0.01f);
                cycle.SetDelay(35);
                cycle.SetLineWidth(10);
                cycle.AddPath(Cycle.LINE, 20 * scale, 70 * scale, 50 * scale,
                              20 * scale);
                cycle.AddPath(Cycle.LINE, 50 * scale, 20 * scale, 80 * scale,
                              70 * scale);
                cycle.AddPath(Cycle.LINE, 80 * scale, 70 * scale, 20 * scale,
                              70 * scale);
                break;

            case 7:
                cycle.SetColor(0xD4FF00);
                cycle.SetStepsPerFrame(3);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.01f);
                cycle.SetLineWidth(6);
                cycle.SetPadding(0);
                cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 20 * scale, 360, 0);
                break;

            case 8:
                cycle.SetColor(0x05E2FF);
                cycle.SetStepsPerFrame(1);
                cycle.SetTrailLength(1);
                cycle.SetPointDistance(0.02f);
                cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 30 * scale, 0, 360);
                break;

            case 9:
                cycle.SetStepType(1);
                cycle.SetColor(LColor.yellow);
                cycle.AddPath(Cycle.LINE, 10 * scale, 10 * scale, 90 * scale,
                              10 * scale);
                cycle.AddPath(Cycle.LINE, 90 * scale, 10 * scale, 90 * scale,
                              90 * scale);
                cycle.AddPath(Cycle.LINE, 90 * scale, 90 * scale, 10 * scale,
                              90 * scale);
                cycle.AddPath(Cycle.LINE, 10 * scale, 90 * scale, 10 * scale,
                              10 * scale);
                break;
            }
            float size = MathUtils.Min(srcWidth / (1 / cycle.GetPointDistance()),
                                       srcHeight / (1 / cycle.GetPointDistance()));

            cycle.SetPadding(padding);
            cycle.SetBlockWidth(size + offset);
            cycle.SetBlockHeight(size + offset);
            cycle.SetWidth(width * scale);
            cycle.SetHeight(height * scale);
            return(cycle);
        }
Example #4
0
        private static Cycle NewSample(int type, float srcWidth,
                                       float srcHeight)
        {
            float width   = 1;
            float height  = 1;
            float offset  = 0;
            int   padding = 0;

            switch (type)
            {
            case 0:
                offset = 12;
                if (srcWidth < srcHeight)
                {
                    width   = 60;
                    height  = 60;
                    padding = -35;
                }
                else
                {
                    width   = 100;
                    height  = 100;
                    padding = -35;
                }
                break;

            case 1:
                width  = 100;
                height = 40;
                if (srcWidth < srcHeight)
                {
                    offset = 0;
                }
                else
                {
                    offset = 8;
                }
                break;

            case 2:
                width  = 30;
                height = 30;
                if (srcWidth < srcHeight)
                {
                    offset = 0;
                }
                else
                {
                    offset = 6;
                }
                break;

            case 3:
                width   = 100;
                height  = 100;
                padding = -30;
                break;

            case 4:
                width   = 80;
                height  = 80;
                offset  = 14;
                padding = -15;
                break;

            case 5:
                width  = 100;
                height = 100;
                if (srcWidth < srcHeight)
                {
                    offset = -4;
                }
                break;

            case 6:
                width  = 60;
                height = 60;
                offset = 12;
                if (srcWidth < srcHeight)
                {
                    padding = -60;
                }
                else
                {
                    padding = -80;
                }
                break;

            case 7:
                width  = 60;
                height = 60;
                offset = 12;
                if (srcWidth < srcHeight)
                {
                    padding = -80;
                }
                else
                {
                    padding = -120;
                }
                break;

            case 8:
                width  = 60;
                height = 60;
                offset = 12;
                if (srcWidth < srcHeight)
                {
                    padding = -60;
                }
                else
                {
                    padding = -80;
                }
                break;

            case 9:
                width  = 80;
                height = 80;
                if (srcWidth < srcHeight)
                {
                    offset  = -2;
                    padding = -20;
                }
                else
                {
                    padding = -30;
                }
                break;
            }
            return(Cycle.GetSample(type, srcWidth, srcHeight, width, height,
                                   offset, padding));
        }