summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/com/ilotterytea/maxoning/ui/InventoryAnimatedItem.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/InventoryAnimatedItem.java b/core/src/com/ilotterytea/maxoning/ui/InventoryAnimatedItem.java
new file mode 100644
index 0000000..d7db2ad
--- /dev/null
+++ b/core/src/com/ilotterytea/maxoning/ui/InventoryAnimatedItem.java
@@ -0,0 +1,26 @@
+package com.ilotterytea.maxoning.ui;
+
+import com.badlogic.gdx.scenes.scene2d.ui.*;
+import com.ilotterytea.maxoning.player.MaxonItem;
+
+public class InventoryAnimatedItem extends Stack {
+ public InventoryAnimatedItem(
+ MaxonItem item,
+ Skin skin,
+ Integer amount
+ ) {
+ super(new Image(item.icon.getDrawable()));
+
+ Table table = new Table();
+ table.setSize(super.getWidth(), super.getHeight());
+ table.add(new Label(String.format("x%s", amount), skin, "default")).bottom().right();
+
+ TextTooltip.TextTooltipStyle style = new TextTooltip.TextTooltipStyle();
+ style.label = new Label.LabelStyle();
+ style.label.font = skin.getFont("default_lidl");
+ style.label.fontColor = skin.getColor("white");
+
+ super.add(table);
+ super.addListener(new TextTooltip(String.format("%s (%s)", item.name, item.multiplier), style));
+ }
+}