-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashForm.cs
More file actions
100 lines (83 loc) · 3.26 KB
/
Copy pathSplashForm.cs
File metadata and controls
100 lines (83 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
public class SplashForm : Form
{
private Timer timer;
private int elapsed = 0;
public SplashForm()
{
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.CenterScreen;
this.Size = new Size(500, 320);
this.BackColor = Color.FromArgb(30, 30, 40);
this.DoubleBuffered = true;
timer = new Timer();
timer.Interval = 50;
timer.Tick += (s, e) =>
{
elapsed++;
this.Invalidate();
if (elapsed >= 80)
{
timer.Stop();
this.Close();
}
};
timer.Start();
this.Paint += SplashForm_Paint;
}
private void SplashForm_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
int w = this.ClientSize.Width;
int h = this.ClientSize.Height;
float progress = Math.Min(1f, elapsed / 60f);
using (Brush bg = new SolidBrush(Color.FromArgb(20, 20, 30)))
g.FillRectangle(bg, 0, 0, w, h);
using (Font titleFont = new Font("Segoe UI", 28, FontStyle.Bold))
using (Font subFont = new Font("Segoe UI", 14))
using (Font smallFont = new Font("Segoe UI", 9))
{
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
int centerY = h / 2 - 30;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
using (Brush titleBrush = new SolidBrush(Color.FromArgb(
(int)(255 * progress), 230, 230, 240)))
{
g.DrawString("Roblox Mode", titleFont, titleBrush,
new Rectangle(0, centerY - 60, w, 60), sf);
}
using (Brush subBrush = new SolidBrush(Color.FromArgb(
(int)(200 * progress), 130, 180, 255)))
{
g.DrawString("RQBBOX | RhysTech", subFont, subBrush,
new Rectangle(0, centerY + 10, w, 40), sf);
}
using (Pen linePen = new Pen(Color.FromArgb(
(int)(100 * progress), 100, 150, 220), 2))
{
int lineY = centerY + 55;
int lineW = 200;
g.DrawLine(linePen, w / 2 - lineW / 2, lineY, w / 2 + lineW / 2, lineY);
}
int barY = h - 60;
int barW = 300;
int barH = 4;
float loadProgress = Math.Min(1f, elapsed / 60f);
using (Brush barBg = new SolidBrush(Color.FromArgb(50, 50, 60)))
g.FillRectangle(barBg, w / 2 - barW / 2, barY, barW, barH);
using (Brush barFill = new SolidBrush(Color.FromArgb(80, 150, 255)))
g.FillRectangle(barFill, w / 2 - barW / 2, barY,
(int)(barW * loadProgress), barH);
string ver = "v1.0.0";
using (Brush verBrush = new SolidBrush(Color.FromArgb(80, 80, 100)))
g.DrawString(ver, smallFont, verBrush,
new Rectangle(0, barY + 10, w, 20), sf);
}
}
}