summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2022-09-04 22:53:17 +0600
committerilotterytea <iltsu@alright.party>2022-09-04 22:53:17 +0600
commit89281f9fe7720beb08ccc84246d552964da10876 (patch)
tree6f2348a22e1ffbc2f41989d04893c3d6ba93fd0a /core
parent418b30eb80dc476acc9fe24bf2f08f95f96cec84 (diff)
animated item for inventory
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));
+ }
+}