diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb index ccfcf5b..52ecabf 100644 --- a/DangerousD/Content/Content.mgcb +++ b/DangerousD/Content/Content.mgcb @@ -41,6 +41,18 @@ /processorParam:TextureFormat=Compressed /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 /importer:TextureImporter /processor:TextureProcessor diff --git a/DangerousD/Content/menuFon.jpg b/DangerousD/Content/menuFon.jpg new file mode 100644 index 0000000..4f49988 Binary files /dev/null and b/DangerousD/Content/menuFon.jpg differ diff --git a/DangerousD/GameCore/GUI/AbstractGui.cs b/DangerousD/GameCore/GUI/AbstractGui.cs index 892cb48..24af331 100644 --- a/DangerousD/GameCore/GUI/AbstractGui.cs +++ b/DangerousD/GameCore/GUI/AbstractGui.cs @@ -26,7 +26,7 @@ public abstract class AbstractGui : IDrawableObject public virtual void LoadContent() { - Manager.LoadContent(AppManager.Instance.Content, "Font"); + Manager.LoadContent(AppManager.Instance.Content, "Font2"); } public virtual void Update(GameTime gameTime) diff --git a/DangerousD/GameCore/GUI/MenuGUI.cs b/DangerousD/GameCore/GUI/MenuGUI.cs index fd42e6b..62ff7c0 100644 --- a/DangerousD/GameCore/GUI/MenuGUI.cs +++ b/DangerousD/GameCore/GUI/MenuGUI.cs @@ -1,5 +1,6 @@ using DangerousD.GameCore.Managers; using Microsoft.Xna.Framework; +using MonogameLibrary.UI.Base; using MonogameLibrary.UI.Elements; using System.Diagnostics; @@ -11,10 +12,11 @@ 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((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 menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "menuFon" }; + Elements.Add(menuBackground); + menuBackground.LoadTexture(AppManager.Instance.Content); + 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" }; Elements.Add(butSingle); butSingle.LeftButtonPressed += () => diff --git a/MonogameLibrary/UI/Base/DrawableUIElement.cs b/MonogameLibrary/UI/Base/DrawableUIElement.cs index 54a0db5..58e739b 100644 --- a/MonogameLibrary/UI/Base/DrawableUIElement.cs +++ b/MonogameLibrary/UI/Base/DrawableUIElement.cs @@ -15,7 +15,7 @@ namespace MonogameLibrary.UI.Base protected Texture2D texture; protected int layerIndex; protected UIManager Manager; - protected string textureName; + public string textureName; public Rectangle rectangle = new Rectangle(0, 0, 10, 10); public Color mainColor = Color.White;