diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-05 23:36:30 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-05 23:36:30 +0100 |
commit | 41746c8d9ceb4313af60ae92697f63897e4acbb7 (patch) | |
tree | a1d2ff86d726d89b8273103c72d83dffe0a23782 /core/src/ch | |
parent | 4eda8cc42f83d3c8c55fd093feb6dd4bd4b7e951 (diff) | |
download | RustAndDust-41746c8d9ceb4313af60ae92697f63897e4acbb7.zip RustAndDust-41746c8d9ceb4313af60ae92697f63897e4acbb7.tar.gz |
UnitDock: ugly fix to support different size pawns
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/UnitDock.java | 10 |
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(); |