This commit is contained in:
gravity 2023-08-16 17:14:37 +03:00
parent de62568872
commit 50edd04b14
5 changed files with 20 additions and 6 deletions

View file

@ -41,6 +41,18 @@
/processorParam:TextureFormat=Compressed /processorParam:TextureFormat=Compressed
/build:Font2.spritefont /build:Font2.spritefont
#begin menuFon.jpg
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:menuFon.jpg
#begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png #begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

View file

@ -26,7 +26,7 @@ public abstract class AbstractGui : IDrawableObject
public virtual void LoadContent() public virtual void LoadContent()
{ {
Manager.LoadContent(AppManager.Instance.Content, "Font"); Manager.LoadContent(AppManager.Instance.Content, "Font2");
} }
public virtual void Update(GameTime gameTime) public virtual void Update(GameTime gameTime)

View file

@ -1,5 +1,6 @@
using DangerousD.GameCore.Managers; using DangerousD.GameCore.Managers;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MonogameLibrary.UI.Base;
using MonogameLibrary.UI.Elements; using MonogameLibrary.UI.Elements;
using System.Diagnostics; using System.Diagnostics;
@ -11,10 +12,11 @@ internal class MenuGUI : AbstractGui
{ {
int wigth = AppManager.Instance.Window.ClientBounds.Width; int wigth = AppManager.Instance.Window.ClientBounds.Width;
int height = AppManager.Instance.Window.ClientBounds.Height; int height = AppManager.Instance.Window.ClientBounds.Height;
var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "menuFon" };
Elements.Add(menuBackground);
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 }); menuBackground.LoadTexture(AppManager.Instance.Content);
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 }); Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2 - 60, 60, 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, 90, 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" }; var butSingle = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 130, 300, 50), text = "Singleplayer", fontName = "ButtonFont" };
Elements.Add(butSingle); Elements.Add(butSingle);
butSingle.LeftButtonPressed += () => butSingle.LeftButtonPressed += () =>

View file

@ -15,7 +15,7 @@ namespace MonogameLibrary.UI.Base
protected Texture2D texture; protected Texture2D texture;
protected int layerIndex; protected int layerIndex;
protected UIManager Manager; protected UIManager Manager;
protected string textureName; public string textureName;
public Rectangle rectangle = new Rectangle(0, 0, 10, 10); public Rectangle rectangle = new Rectangle(0, 0, 10, 10);
public Color mainColor = Color.White; public Color mainColor = Color.White;