aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/MainMenu.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-25 17:57:50 -0400
committerMichael <[email protected]>2017-07-25 17:57:50 -0400
commit6114fe5af6faa679c477cf8eb9fccb95029df3b5 (patch)
tree2fa65cca4ae0d77bb91397ca862c6a31821260a3 /ShiftOS.Frontend/MainMenu.cs
parent6e03daf60a2c9c1eec20d2bc069861c334a4c9c5 (diff)
downloadshiftos_thereturn-6114fe5af6faa679c477cf8eb9fccb95029df3b5.tar.gz
shiftos_thereturn-6114fe5af6faa679c477cf8eb9fccb95029df3b5.tar.bz2
shiftos_thereturn-6114fe5af6faa679c477cf8eb9fccb95029df3b5.zip
start work on main menu
Diffstat (limited to 'ShiftOS.Frontend/MainMenu.cs')
-rw-r--r--ShiftOS.Frontend/MainMenu.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/ShiftOS.Frontend/MainMenu.cs b/ShiftOS.Frontend/MainMenu.cs
new file mode 100644
index 0000000..0d2b1ef
--- /dev/null
+++ b/ShiftOS.Frontend/MainMenu.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ShiftOS.Engine;
+using ShiftOS.Frontend.GUI;
+using ShiftOS.Frontend.GraphicsSubsystem;
+using Microsoft.Xna.Framework;
+
+namespace ShiftOS.Frontend
+{
+ public class MainMenu : GUI.Control
+ {
+ public MainMenu()
+ {
+ X = 0;
+ Y = 0;
+ Width = UIManager.Viewport.Width;
+ Height = UIManager.Viewport.Height;
+ }
+
+ private Color _redbg = new Color(127, 0, 0, 255);
+ private Color _bluebg = new Color(0, 0, 127, 255);
+ private float _bglerp = 0.0f;
+ private int _lerpdir = 1;
+
+ protected override void OnLayout(GameTime gameTime)
+ {
+ if (_lerpdir == 1)
+ _bglerp += 0.001f;
+ else
+ _bglerp -= 0.001f;
+ if (_bglerp <= 0.0)
+ _lerpdir = 1;
+ else if (_bglerp >= 1)
+ _lerpdir = -1;
+ Invalidate();
+ }
+
+ protected override void OnPaint(GraphicsContext gfx)
+ {
+ gfx.DrawRectangle(0, 0, Width, Height, Color.Lerp(_redbg, _bluebg, _bglerp));
+ gfx.DrawString("ShiftOS", 30, 30, Color.White, new System.Drawing.Font("Consolas", 48f));
+
+ }
+ }
+}