Exemplo n.º 1
0
        public void DrawNameThing()
        {
            string[][] names =
                                {
                                    new string[]
                                    {
                                        Translate("D"),
                                        Translate("e"),
                                        Translate("p"),
                                        Translate("t"),
                                        Translate("h"),
                                        Translate("s"),
                                    },

                                    new string[]
                                    {
                                        Translate("C"),
                                        Translate("r"),
                                        Translate("y"),
                                        Translate("s"),
                                        Translate("t"),
                                        Translate("a"),
                                        Translate("l"),
                                    }
                                };
            int offsetx = 320;
            int y = 110;
            double size = .7;
            double size2 = size * .7;
            double radius = 80;
            double letterSize = .4;
            int lineLength = 215;
            int lineWidth = 40;
            int dist = 20;
            int offsetLettersX = -5;
            int offsetLettersY = 0;
            Color2 c = new Color2(148, 196, 255);

            //left: Depths
            Sprite line1 = Mathematics.DrawLines(beginning, 1, lineWidth, Sprite.origin.TopLeft);
            line1.Move(beginning, 320 - offsetx, y - (int)radius);
            Mathematics.ScaleLines(line1, 1, beginning + beat, beginning + beat * 2, lineLength, lineWidth);
            line1.Color(c.red, c.green, c.blue);
            line1.Fade(beginning + beat, beginning + beat * 2, 0, 1);
            line1.Fade(ending - beat * 2, ending - beat, 1, 0);

            Sprite circle1 = new Sprite(@"sb\etc\circle.png");
            circle1.Move(beginning, 320 - offsetx, y);
            circle1.Fade(beginning, beginning + beat, 0, 1);
            circle1.Fade(ending - beat, ending, 1, 0);
            circle1.Scale(beginning, size);

            Sprite circle2 = new Sprite(@"sb\etc\circle.png");
            circle2.Move(beginning, 320 - offsetx, y);
            circle2.Fade(beginning, beginning + beat, 0, 1);
            circle2.Fade(ending - beat, ending, 1, 0);
            circle2.Scale(beginning, size2);
            circle2.Color(c.red, c.green, c.blue);

            for (int i = 0; i < names[0].Length; i++)
            {
                Sprite letter = new Sprite($@"sb\text\{names[0][i]}.png", Sprite.origin.TopCentre);
                letter.Move(beginning, 320 - offsetx + (int)radius + offsetLettersX + i * dist, y - (int)radius - offsetLettersY);
                letter.Fade(beginning + beat * 2, beginning + beat * 2.5, 0, 1);
                letter.Fade(ending - beat * 2, ending - beat, 1, 0);
                letter.Scale(letterSize);
            }

            //right: Crystal
            Sprite line2 = Mathematics.DrawLines(beginning, 1, lineWidth, Sprite.origin.BottomRight);
            line2.Move(beginning, 320 + offsetx, y + (int)radius);
            Mathematics.ScaleLines(line2, 1, beginning + beat, beginning + beat * 2, lineLength, lineWidth);
            line2.Color(c.blue, c.red, c.green);
            line2.Fade(beginning + beat, beginning + beat * 2, 0, 1);
            line2.Fade(ending - beat * 2, ending - beat, 1, 0);

            Sprite circle3 = new Sprite(@"sb\etc\circle.png");
            circle3.Move(beginning, 320 + offsetx, y);
            circle3.Fade(beginning, beginning + beat, 0, 1);
            circle3.Fade(ending - beat, ending, 1, 0);
            circle3.Scale(beginning, size);

            Sprite circle4 = new Sprite(@"sb\etc\circle.png");
            circle4.Move(beginning, 320 + offsetx, y);
            circle4.Fade(beginning, beginning + beat, 0, 1);
            circle4.Fade(ending - beat, ending, 1, 0);
            circle4.Scale(beginning, size2);
            circle4.Color(c.blue, c.red, c.green);

            for (int i = 0; i < names[1].Length; i++)
            {
                Sprite letter = new Sprite($@"sb\text\{names[1][i]}.png", Sprite.origin.BottomCentre);
                letter.Move(beginning, 320 + offsetx - (int)radius - offsetLettersX - (names[1].Length - i - 1) * dist, y + (int)radius + offsetLettersY);
                letter.Fade(beginning + beat * 2, beginning + beat * 2.5, 0, 1);
                letter.Fade(ending - beat * 2, ending - beat, 1, 0);
                letter.Scale(letterSize);
            }
        }
Exemplo n.º 2
0
        public void DrawLyrics1(int line, double startTime, double endTime, int isRight)
        {
            int ox, rx, y;
            int length = (lyrics[line].Count - 2) * 40;
            int size = 40;
            int range = 40;
            int x1 = isRight == 1 ? 320 : (-108 + length / 2 + range);
            int y1 = 240 + size;
            int x2 = isRight == 1 ? (750 - length / 2 - range) : 320;
            int y2 = 480 - size;
            Color2 c1 = new Color2(220, 219, 173);
            Color2 c2 = new Color2(220, 219, 173);

            ox = rand.Next(x1, x2) - (length % 2 == 0 ? 15 : 0);
            y = rand.Next(y1, y2);

            if (isRight > 1)
            {
                ox = 320;
                y = 360;
                c2 = new Color2(174, 200, 220);
                c1 = new Color2(174, 200, 220);
            }

            rx = ox - length / 2;

            double speed = (endTime - startTime) / 1000 * 1;
            for (int i = 1; i < lyrics[line].Count; i++)
            {
                Sprite letter = new Sprite(string.Format(@"sb\text\{0}.png", lyrics[line][i]));
                letter.Scale(.4);
                letter.MoveX(startTime, endTime, rx + (i - 1) * 40, rx + (i - 1) * 40);
                letter.MoveY(startTime, endTime, y, y + rand.Next((int)speed - 5, (int)speed + 5) * (rand.Next(0, 2) == 1  ?  1 : -1));
                letter.Fade(startTime, startTime + beat / 2, 0, 1);
                letter.Fade(endTime - beat / 2, endTime, 1, 0);
                letter.Color(c1.red, c1.green, c1.blue);
            }

            //lines
            Sprite line1 = Mathematics.DrawLines(startTime, 1, 5, Sprite.origin.CentreLeft);
            int offset = 30;

            line1.Move(startTime, endTime, rx - 30, y + offset, rx - 30, y + offset);
            line1.Fade(startTime, startTime + beat / 2, 0, 1);
            Mathematics.ScaleLines(line1, 1, startTime, startTime + beat / 2, length + 60, 5);
            line1.Color(c2.red, c2.green, c2.blue);

            Sprite line2 = Mathematics.DrawLines(startTime, 1, 5, Sprite.origin.CentreRight);

            line2.Move(startTime, endTime, rx + ((lyrics[line].Count - 2) * 40) + 30, y - offset, rx + ((lyrics[line].Count - 2) * 40) + 30, y - offset);
            line2.Fade(startTime, startTime + beat / 2, 0, 1);
            Mathematics.ScaleLines(line2, 1, startTime, startTime + beat / 2, length + 60, 5);
            line2.Color(c2.red, c2.green, c2.blue);

            BubblingThing(startTime, endTime, ox, y + offset, length + 60, 1);
            BubblingThing(startTime, endTime, ox, y - offset, length + 60, -1);
        }
Exemplo n.º 3
0
        public void DrawName()
        {
            Queue<int> timing = LyricTiming(@"D:\Library\Game\osu!\Songs\334725 ChouCho - Starlog(Asterisk Remix)\ChouCho - Starlog(Asterisk Remix) (Depths) [part].osu");
            int dir = -1;
            int offsetx = 320;
            int t = timing.Dequeue();
            int tNext = 0;
            Color2 c = new Color2(148, 196, 255);

            while (timing.Count > 0)
            {
                int r, g, b;
                r = dir == 1 ? c.red : c.blue;
                g = dir == 1 ? c.green : c.red;
                b = dir == 1 ? c.blue : c.green;
                tNext = timing.Dequeue();
                Sprite timeline = Mathematics.DrawLines(t, 215, 10, dir == -1 ? Sprite.origin.TopLeft : Sprite.origin.BottomRight);
                timeline.Move(t, 320 + offsetx * dir, 110 + 40 * dir);
                Mathematics.ScaleLines(timeline, 0, t, tNext, 73, 10);
                timeline.Fade(t, t + beat, 0, 1);
                if (timing.Count == 0)
                {
                    timeline.Fade(ending - beat * 2, ending - beat, 1, 0);
                }
                else
                {
                    timeline.Fade(tNext, tNext + beat, 1, 0);
                }
                timeline.Color(r, g, b);

                t = tNext;
                dir *= -1;
            }
            DrawNameThing();
        }
Exemplo n.º 4
0
        public static Color2 HSL2RGB(double h, double sl, double l)
        {
            double v;
            double r, g, b;

            r = l;   // default to gray
            g = l;
            b = l;
            v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl);
            if (v > 0)
            {
                double m;
                double sv;
                int sextant;
                double fract, vsf, mid1, mid2;

                m = l + l - v;
                sv = (v - m) / v;
                h *= 6.0;
                sextant = (int)h;
                fract = h - sextant;
                vsf = v * sv * fract;
                mid1 = m + vsf;
                mid2 = v - vsf;
                switch (sextant)
                {
                    case 0:
                        r = v;
                        g = mid1;
                        b = m;
                        break;
                    case 1:
                        r = mid2;
                        g = v;
                        b = m;
                        break;
                    case 2:
                        r = m;
                        g = v;
                        b = mid1;
                        break;
                    case 3:
                        r = m;
                        g = mid2;
                        b = v;
                        break;
                    case 4:
                        r = mid1;
                        g = m;
                        b = v;
                        break;
                    case 5:
                        r = v;
                        g = m;
                        b = mid2;
                        break;
                }
            }
            Color2 rgb = new Color2((int)(r * 255), (int)(g * 255), (int)(b * 255));
            return rgb;
        }