From de62568872c4519fa436caf0351d54667c1df4a8 Mon Sep 17 00:00:00 2001 From: gravity Date: Wed, 16 Aug 2023 16:19:07 +0300 Subject: [PATCH] ui --- DangerousD/GameCore/GUI/MenuGUI.cs | 10 +++++++++- DangerousD/GameCore/Managers/AppManager.cs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DangerousD/GameCore/GUI/MenuGUI.cs b/DangerousD/GameCore/GUI/MenuGUI.cs index 72d0566..fd42e6b 100644 --- a/DangerousD/GameCore/GUI/MenuGUI.cs +++ b/DangerousD/GameCore/GUI/MenuGUI.cs @@ -1,6 +1,7 @@ using DangerousD.GameCore.Managers; using Microsoft.Xna.Framework; using MonogameLibrary.UI.Elements; +using System.Diagnostics; namespace DangerousD.GameCore.GUI; @@ -10,8 +11,10 @@ internal class MenuGUI : AbstractGui { int wigth = AppManager.Instance.Window.ClientBounds.Width; int height = AppManager.Instance.Window.ClientBounds.Height; + - Elements.Add(new Label(Manager) { rectangle = new Rectangle(10, 10, 50, 50), text = "Dangerous" }); + Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 - 60, 30, 50, 50), text = "Dangerous", mainColor = Color.Transparent, scale = 0.7f, fontName = "Font2", fontColor = Color.White }); + Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 + 250, 60, 50, 50), text = "D", mainColor = Color.Transparent, scale = 1.2f, fontName = "Font2", fontColor = Color.White }); var butSingle = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 130, 300, 50), text = "Singleplayer", fontName = "ButtonFont" }; Elements.Add(butSingle); butSingle.LeftButtonPressed += () => @@ -37,4 +40,9 @@ internal class MenuGUI : AbstractGui AppManager.Instance.Exit(); }; } + + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + } } \ No newline at end of file diff --git a/DangerousD/GameCore/Managers/AppManager.cs b/DangerousD/GameCore/Managers/AppManager.cs index 0263fa0..ee55b5d 100644 --- a/DangerousD/GameCore/Managers/AppManager.cs +++ b/DangerousD/GameCore/Managers/AppManager.cs @@ -36,7 +36,7 @@ namespace DangerousD.GameCore resolution = new Point(_graphics.PreferredBackBufferWidth, _graphics.PreferredBackBufferHeight); GameManager = new GameManager(); - gameState = GameState.Lobby; + gameState = GameState.Menu; MenuGUI = new MenuGUI(); LoginGUI = new LoginGUI(); LobbyGUI = new LobbyGUI();