diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb index 87478e5..c977303 100644 --- a/DangerousD/Content/Content.mgcb +++ b/DangerousD/Content/Content.mgcb @@ -14,30 +14,6 @@ #---------------------------------- Content ---------------------------------# -#begin MonstersAnimations.png -/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:MonstersAnimations.png - -#begin deathAnimation.png -/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:deathAnimation.png - #begin ButtonFont.spritefont /importer:FontDescriptionImporter /processor:FontDescriptionProcessor @@ -45,13 +21,6 @@ /processorParam:TextureFormat=Compressed /build:ButtonFont.spritefont - -#begin DoomTestSong.mp3 -/importer:Mp3Importer -/processor:SoundEffectProcessor -/processorParam:Quality=Best -/build:DoomTestSong.mp3 - #begin checkboxs_off-on.png /importer:TextureImporter /processor:TextureProcessor @@ -88,6 +57,18 @@ /processorParam:TextureFormat=Color /build:checkboxs_on.png +#begin deathAnimation.png +/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:deathAnimation.png + #begin deathBackground.jpg /importer:TextureImporter /processor:TextureProcessor @@ -100,6 +81,12 @@ /processorParam:TextureFormat=Color /build:deathBackground.jpg +#begin DoomTestSong.mp3 +/importer:Mp3Importer +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:DoomTestSong.mp3 + #begin Font_25.spritefont /importer:FontDescriptionImporter /processor:FontDescriptionProcessor @@ -133,18 +120,6 @@ /processorParam:TextureFormat=Color /build:menuFon.jpg -#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 MenuFon2.jpg /importer:TextureImporter /processor:TextureProcessor @@ -169,18 +144,6 @@ /processorParam:TextureFormat=Color /build:menuFon3.jpg -#begin tiles.png -/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:tiles.png - #begin MonstersAnimations.png /importer:TextureImporter /processor:TextureProcessor @@ -217,6 +180,30 @@ /processorParam:TextureFormat=Color /build:PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png +#begin slider.png +/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:slider.png + +#begin sliderBackground.png +/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:sliderBackground.png + #begin textboxbackground1-1.png /importer:TextureImporter /processor:TextureProcessor @@ -265,6 +252,18 @@ /processorParam:TextureFormat=Color /build:textboxbackground6-1.png +#begin tiles.png +/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:tiles.png + #begin wall.jpg /importer:TextureImporter /processor:TextureProcessor diff --git a/DangerousD/Content/slider.png b/DangerousD/Content/slider.png new file mode 100644 index 0000000..624b533 Binary files /dev/null and b/DangerousD/Content/slider.png differ diff --git a/DangerousD/Content/sliderBackground.png b/DangerousD/Content/sliderBackground.png new file mode 100644 index 0000000..8560739 Binary files /dev/null and b/DangerousD/Content/sliderBackground.png differ diff --git a/DangerousD/GameCore/GUI/LobbyGUI.cs b/DangerousD/GameCore/GUI/LobbyGUI.cs index 49d25f2..9136760 100644 --- a/DangerousD/GameCore/GUI/LobbyGUI.cs +++ b/DangerousD/GameCore/GUI/LobbyGUI.cs @@ -45,9 +45,10 @@ namespace DangerousD.GameCore.GUI screenWidth / 30 * 10, screenHeight / 30 * 3), text = "ip", scale = 0.16f, - fontColor = Color.Gray, + fontColor = Color.Black, fontName = "font2", - textAligment = TextAligment.Left + textAligment = TextAligment.Left, + textureName = "textboxbackground6-1" }; searchBarTextBox.TextChanged += input => { diff --git a/DangerousD/GameCore/GUI/OptionsGUI.cs b/DangerousD/GameCore/GUI/OptionsGUI.cs index b086967..2236613 100644 --- a/DangerousD/GameCore/GUI/OptionsGUI.cs +++ b/DangerousD/GameCore/GUI/OptionsGUI.cs @@ -23,7 +23,9 @@ namespace DangerousD.GameCore.GUI { MinValue = 0, MaxValue = 1, - rectangle = new Rectangle(wigth / 2 + 220, 275, (int)(100 * 2.4), 40) + rectangle = new Rectangle(wigth / 2 + 220, 275, (int)(100 * 2.4), 40), + indentation = 5, + textureName = "sliderBackground" }; var cB = new CheckBox(Manager); diff --git a/MonogameLibrary/UI/Elements/Slider.cs b/MonogameLibrary/UI/Elements/Slider.cs index 7888d70..8db7152 100644 --- a/MonogameLibrary/UI/Elements/Slider.cs +++ b/MonogameLibrary/UI/Elements/Slider.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using MonogameLibrary.UI.Base; @@ -17,7 +18,9 @@ namespace MonogameLibrary.UI.Elements } public delegate void OnSliderChanges(float value); public event OnSliderChanges? SliderChanged; + public int indentation = 5; + Texture2D texture2; public Rectangle sliderRect = new Rectangle(0, 0, 30, 30); private float sliderValue = 0; private float minValue = 0, maxValue = 1; @@ -50,6 +53,13 @@ namespace MonogameLibrary.UI.Elements sliderState = SliderState.None; return false; } + + public override void LoadTexture(ContentManager content) + { + texture2 = content.Load("slider"); + base.LoadTexture(content); + } + public void SetValue(float setvalue) { sliderValue = setvalue; @@ -60,14 +70,14 @@ namespace MonogameLibrary.UI.Elements { base.Draw(_spriteBatch); sliderRect.Location = rectangle.Location; - sliderRect.X += (int)(sliderValue * (rectangle.Width - sliderRect.Width)); + sliderRect.X += (int)(sliderValue * (rectangle.Width - sliderRect.Width - indentation * 2) + indentation); sliderRect.Y -= sliderRect.Height / 2 - rectangle.Height / 2; if (sliderState == SliderState.Moving) - _spriteBatch.Draw(texture, sliderRect, Color.DarkRed); + _spriteBatch.Draw(texture2, sliderRect, Color.DarkRed); else if(sliderState == SliderState.HoveringOverSliderButton) - _spriteBatch.Draw(texture, sliderRect, new Color(200,0,0)); + _spriteBatch.Draw(texture2, sliderRect, new Color(200,0 ,0)); else - _spriteBatch.Draw(texture, sliderRect, Color.Red); + _spriteBatch.Draw(texture2, sliderRect, Color.Red); DrawText(_spriteBatch); } }