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); }
public Sprite[][] DrawHexagon() { double size = 15; double width = 1366 * Control.scale; int cx = 320; int cy = 320; double radius = size / 2; double scale = size / 100.0; double percentagex = 1; double percentagey = 1; double intervalx = radius * Math.Cos(30.0 * (Math.PI / 180.0)) * percentagex; double intervaly = 2 * ((radius) * Math.Sin(30.0 * (Math.PI / 180.0))) + size * percentagey; int amountx = (int)((width) / intervalx) + 5; Sprite[][] hexagons = new Sprite[amountx][]; for (int i = 0; i < hexagons.Length; i++) { double t = Math.Abs(i - amountx / 2) * (10 / width); double height = Math.Pow(t, 2) * 400; int amounty = (int)((height) / intervaly) + 5; hexagons[i] = new Sprite[amounty]; for (int j = 0; j < hexagons[i].Length; j++) { Sprite hexagon = new Sprite(@"sb\etc\hexagon.png", Sprite.layer.Background); if (i < amountx / 2) { hexagon.MoveX((int)(cx - (intervalx * (amountx / 2 - i)))); } else { hexagon.MoveX((int)(cx + (intervalx * (i - amountx / 2)))); } if (i % 2 == 0) { if (j < amounty / 2) { hexagon.MoveY((int)(cy - (intervaly * (amounty / 2 - j)))); } else { hexagon.MoveY((int)(cy + (intervaly * (j - amounty / 2)))); } } else { if (j < amounty / 2) { hexagon.MoveY((int)(cy - (intervaly * (amounty / 2 - j)) + (radius + (radius * Math.Sin(30.0 * (Math.PI / 180.0)))))); } else { hexagon.MoveY((int)(cy + (intervaly * (j - amounty / 2)) + (radius + (radius * Math.Sin(30.0 * (Math.PI / 180.0)))))); } } hexagon.Scale(scale); hexagon.Parameters(0, 0, "A"); hexagon.Fade(0); Color2 h = Color2.HSL2RGB((double)i / hexagons.Length, .7, .4); hexagon.Color(h.red, h.green, h.blue); hexagons[i][j] = hexagon; } } return hexagons; }