added cool sign
This commit is contained in:
parent
dd6728967f
commit
465fc40562
2 changed files with 26 additions and 7 deletions
|
@ -1,9 +1,12 @@
|
|||
using DangerousD.GameCore.Managers;
|
||||
using Microsoft.VisualBasic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MonogameLibrary.UI.Base;
|
||||
using MonogameLibrary.UI.Elements;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace DangerousD.GameCore.GUI;
|
||||
|
@ -11,6 +14,12 @@ namespace DangerousD.GameCore.GUI;
|
|||
internal class MenuGUI : AbstractGui
|
||||
{
|
||||
int selected = 0;
|
||||
Color[] colors = new Color[] { new Color(64, 53, 51), new Color(84, 58, 52),
|
||||
new Color(170, 101, 63), new Color(254, 208, 116), new Color(252, 231, 124) };
|
||||
List<Label> MainLetterLabels = new List<Label>();
|
||||
List<Label> BigLetterLabels = new List<Label>();
|
||||
List<Vector2> MainLetterPositions = new List<Vector2>();
|
||||
List<Vector2> BigLetterPositions = new List<Vector2>();
|
||||
protected override void CreateUI()
|
||||
{
|
||||
int wigth = AppManager.Instance.inGameResolution.X;
|
||||
|
@ -20,16 +29,18 @@ internal class MenuGUI : AbstractGui
|
|||
Elements.Add(menuBackground);
|
||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||
|
||||
Color[] colors = new Color[] { new Color(64, 53, 51), new Color(84, 58, 52),
|
||||
new Color(170, 101, 63), new Color(254, 208, 116), new Color(252, 231, 124) };
|
||||
for (int i = 0; i < colors.Length; i++)
|
||||
{
|
||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 - 60, 200, 50, 50), text = "Dangerous", mainColor = Color.Transparent, scale = 1.35f - 0.05f * i * i / 10, fontName = "Font2", fontColor = colors[i] });
|
||||
MainLetterLabels.Add(Elements.Last() as Label);
|
||||
}
|
||||
|
||||
int dx = 50;
|
||||
Color[] colors2 = new Color[] { new Color(64, 53, 51), new Color(84, 58, 52),
|
||||
new Color(170, 101, 63), new Color(254, 208, 116), new Color(252, 231, 124) };
|
||||
for (int i = 0; i < colors2.Length; i++)
|
||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 + 480 + dx - i * i, 260 - i * i / 5, 50, 50), text = "D", mainColor = Color.Transparent, scale = 2.15f - 0.05f * i * i / 5, fontName = "Font2", fontColor = colors2[i] });
|
||||
for (int i = 0; i < colors.Length; i++)
|
||||
{
|
||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 + 480 + dx - i * i, 260 - i * i / 5, 50, 50), text = "D", mainColor = Color.Transparent, scale = 2.15f - 0.05f * i * i / 5, fontName = "Font2", fontColor = colors[i] });
|
||||
BigLetterLabels.Add(Elements.Last() as Label);
|
||||
}
|
||||
|
||||
var butSingle = new ButtonText(Manager) { rectangle = new Rectangle((wigth - (int)(300 * 2.4)) / 2, 350, (int)(300 * 2.4), (int)(50 * 2.4)), text = "Singleplayer", scale = 1.2f, fontName = "ButtonFont" };
|
||||
Elements.Add(butSingle);
|
||||
|
@ -61,8 +72,16 @@ internal class MenuGUI : AbstractGui
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
for (int i = 0; i < MainLetterLabels.Count; i++)
|
||||
{
|
||||
MainLetterLabels[i].fontColor = Color.FromNonPremultiplied(colors[i].ToVector4() * (float)((Math.Sin(gameTime.TotalGameTime.TotalSeconds*2) + 1) / 2f + 0.5f)
|
||||
);
|
||||
BigLetterLabels[i].fontColor = Color.FromNonPremultiplied(colors[i].ToVector4() * (float)((Math.Sin(gameTime.TotalGameTime.TotalSeconds * 2) + 1) / 2f + 0.5f)
|
||||
);
|
||||
}
|
||||
base.Update(gameTime);
|
||||
}
|
||||
}
|
|
@ -202,7 +202,7 @@ namespace DangerousD.GameCore
|
|||
case GameState.Lobby:
|
||||
break;
|
||||
case GameState.Game:
|
||||
GameManager.mapManager.LoadLevel("boss");
|
||||
GameManager.mapManager.LoadLevel("lvl");
|
||||
break;
|
||||
case GameState.Death:
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue