diff options
| author | ilotterytea <iltsu@alright.party> | 2022-09-04 23:02:27 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-09-04 23:02:27 +0600 |
| commit | 02ce043702290754f9107d72b1e333ab7c18de63 (patch) | |
| tree | bebfc118018174e253518b2fdf41f25f3a062543 /core/src | |
| parent | 26740150ea4047c5468bde0d9a7e678a76253379 (diff) | |
предмет сделан как я хотел
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java b/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java index f6a03e0..97a78e7 100644 --- a/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java +++ b/core/src/com/ilotterytea/maxoning/ui/PurchaseItem.java @@ -15,26 +15,24 @@ public class PurchaseItem extends Stack { ) { super(new Image(ninepatch)); - Label title = new Label(name, skin, "purchaseitem_title"); - Label description = new Label(desc, skin, "purchaseitem_desc"); - Label cost = new Label(price + "S", skin, "purchaseitem_price"); + Table summary = new Table(); + summary.setHeight(super.getHeight()); + + Label title = new Label(String.format("%s\n(%s)", name, price), skin, "purchaseitem_title"); - title.setAlignment(Align.center); - description.setAlignment(Align.center); - cost.setAlignment(Align.center); + summary.add(title).fillX().row(); + Label description = new Label(desc, skin, "purchaseitem_desc"); description.setWrap(true); - Table table = new Table(); + summary.add(description).fillX().row(); - table.setPosition(0 , super.getHeight()); - table.setWidth(super.getWidth()); + Table main = new Table(); + main.add(icon).size(81, 81).left().pad(5f); + main.add(summary).fillY().fillX().right().pad(5f); - table.add(icon).pad(8).center().row(); - table.add(title).expand().padBottom(8).center().row(); - table.add(description).expand().fillX().center().row(); - table.add(cost).expand().fillX().center().row(); + main.align(Align.left); - super.addActor(table); + super.addActor(main); } } |
