From 41746c8d9ceb4313af60ae92697f63897e4acbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 5 Nov 2014 23:36:30 +0100 Subject: UnitDock: ugly fix to support different size pawns --- core/src/ch/asynk/tankontank/game/hud/UnitDock.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java index e298742..0210dd6 100644 --- a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java +++ b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java @@ -126,11 +126,15 @@ public class UnitDock extends Bg } } - float x = rect.x + PADDING; + // float x = rect.x + PADDING; + float x = rect.x; float y = rect.y + rect.height; + float h = pawns.get(0).getHeight(); for (Pawn pawn : pawns) { - y -= (pawn.getHeight() + PADDING); - pawn.setPosition(x, y, Orientation.SOUTH.r()); + y -= (h + PADDING); + // pawn.setPosition(x, y, Orientation.SOUTH.r()); + pawn.centerOn((x + (rect.width / 2)), y + (h / 2)); + pawn.setRotation(Orientation.SOUTH.r()); } transform.idt(); -- cgit v1.1-2-g2b99