diff --git a/MonogameLibrary/UI/Elements/Bar.cs b/MonogameLibrary/UI/Elements/Bar.cs new file mode 100644 index 0000000..34409b2 --- /dev/null +++ b/MonogameLibrary/UI/Elements/Bar.cs @@ -0,0 +1,49 @@ +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Base; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Input; + +namespace MonogameLibrary.UI.Elements; + +public class Bar : DrawableUIElement +{ + public float percent = 0.5f; + private DrawableUIElement barInside; + public Color inColor; + public string inTextureName; + + public Bar(UIManager manager, int layerIndex = 0, string textureName = "") : base(manager, layerIndex, textureName) + { + } + + public void Initialize() + { + barInside = new DrawableUIElement(Manager) + { + rectangle = new Rectangle(rectangle.X + rectangle.Height / 8, rectangle.Y + rectangle.Height / 8, + (int)((rectangle.Width - rectangle.Height / 4) * percent), rectangle.Height / 8 * 7), + mainColor = inColor, + textureName = inTextureName + }; + } + + public override void LoadTexture(ContentManager content) + { + barInside.LoadTexture(content); + base.LoadTexture(content); + } + + public void Update(GameTime gameTime, float percent) + { + barInside.rectangle = new Rectangle(rectangle.X + rectangle.Height / 8, rectangle.Y + rectangle.Height / 8, + (int)((rectangle.Width - rectangle.Height / 4) * percent), rectangle.Height / 8 * 7); + } +} \ No newline at end of file diff --git a/MonogameLibrary/UI/Elements/HoverWindow.cs b/MonogameLibrary/UI/Elements/HoverWindow.cs new file mode 100644 index 0000000..d6efed9 --- /dev/null +++ b/MonogameLibrary/UI/Elements/HoverWindow.cs @@ -0,0 +1,91 @@ +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Base; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using Microsoft.Xna.Framework.Content; + +namespace MonogameLibrary.UI.Elements; + +public class HoverWindow : DrawableUIElement +{ + public string tagItem; + public string discriptions; + public Dictionary resourcesNeededToCraft; + private List