diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-29 00:20:27 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-29 00:20:27 +0500 |
| commit | e4c5b7fd1069b5c21fc0643c760adea3a3b9d8f4 (patch) | |
| tree | 4f4d5b2801f6fee6081d4df32a419f311181b241 | |
| parent | f271968b97e7e435f79ea99520d9b260ca233caa (diff) | |
feat: shop item hover event
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java b/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java index 0b6f67f..7f6d44c 100644 --- a/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java +++ b/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java @@ -1,6 +1,9 @@ package com.ilotterytea.maxoning.ui; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.ui.*; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.Align; import com.ilotterytea.maxoning.MaxonConstants; import com.ilotterytea.maxoning.player.MaxonItem; @@ -29,5 +32,18 @@ public class PurchaseItem extends Table { summary.add(desc).grow(); super.add(summary).grow(); + + super.addListener(new ClickListener() { + @Override + public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) { + PurchaseItem.super.setBackground("shop_item_hover"); + super.enter(event, x, y, pointer, fromActor); + } + @Override + public void exit(InputEvent event, float x, float y, int pointer, Actor toActor) { + PurchaseItem.super.setBackground("shop_item"); + super.exit(event, x, y, pointer, toActor); + } + }); } } |
