From 02ce043702290754f9107d72b1e333ab7c18de63 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 4 Sep 2022 23:02:27 +0600 Subject: предмет сделан как я хотел MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ilotterytea/maxoning/ui/PurchaseItem.java | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'core/src/com') 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); } } -- cgit v1.2.3