summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-05 23:36:30 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-05 23:36:30 +0100
commit41746c8d9ceb4313af60ae92697f63897e4acbb7 (patch)
treea1d2ff86d726d89b8273103c72d83dffe0a23782
parent4eda8cc42f83d3c8c55fd093feb6dd4bd4b7e951 (diff)
downloadRustAndDust-41746c8d9ceb4313af60ae92697f63897e4acbb7.zip
RustAndDust-41746c8d9ceb4313af60ae92697f63897e4acbb7.tar.gz
UnitDock: ugly fix to support different size pawns
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/UnitDock.java10
1 files 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();