summaryrefslogtreecommitdiff
path: root/source/ui/elements/game/tooltips/ItemDisplay.cs
diff options
context:
space:
mode:
Diffstat (limited to 'source/ui/elements/game/tooltips/ItemDisplay.cs')
-rw-r--r--source/ui/elements/game/tooltips/ItemDisplay.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/ui/elements/game/tooltips/ItemDisplay.cs b/source/ui/elements/game/tooltips/ItemDisplay.cs
new file mode 100644
index 0000000..d3b1524
--- /dev/null
+++ b/source/ui/elements/game/tooltips/ItemDisplay.cs
@@ -0,0 +1,21 @@
+using Celesteia.Resources.Types;
+using Celesteia.UI.Properties;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using MonoGame.Extended.TextureAtlases;
+
+namespace Celesteia.UI.Elements.Game.Tooltips {
+ public class ItemDisplay : Element {
+ public ItemType Item;
+ public int Amount;
+ public TextProperties Text;
+
+ public ItemDisplay(Rect rect) => SetRect(rect);
+
+ public override void Draw(SpriteBatch spriteBatch)
+ {
+ spriteBatch.Draw(Item.Sprite, GetRectangle(), Color.White, null);
+ if (Amount > 1) TextUtilities.DrawAlignedText(spriteBatch, GetRectangle(), Text);
+ }
+ }
+} \ No newline at end of file