From 8818c998b046e9e4c27cdace43bbf15bb89a27f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 17 May 2016 17:49:17 +0200 Subject: PlayerInfo: remove useless calls to setLabelPosition(...) --- core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java index 9f86b13..d822794 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java @@ -41,6 +41,7 @@ public class PlayerInfo implements Disposable, Drawable, Animation aps = new LabelImage(game.factory.getHudRegion(game.factory.HUD_APS), game.font, 5f); reinforcement = new LabelImage(game.factory.getHudRegion(game.factory.REINFORCEMENT), game.font, 5f); unitDock = new UnitDock(game, 10f); + turns.setPosition(Position.TOP_CENTER); } @Override @@ -61,8 +62,7 @@ public class PlayerInfo implements Disposable, Drawable, Animation aps.translate(dx, dy); reinforcement.translate(dx, dy); unitDock.translate(dx, dy); - turns.setPosition(Position.TOP_CENTER); - turns.setLabelPosition(Position.MIDDLE_CENTER); + turns.update(); } public void setPosition(Position position) @@ -93,11 +93,8 @@ public class PlayerInfo implements Disposable, Drawable, Animation x -= (aps.getWidth() + PADDING); aps.setPosition(x, y); } - turns.setPosition(Position.TOP_CENTER); - turns.setLabelPosition(Position.MIDDLE_CENTER); - aps.setLabelPosition(Position.MIDDLE_CENTER); - reinforcement.setLabelPosition(Position.MIDDLE_CENTER); unitDock.setPosition(position, reinforcement.getY() - PADDING); + turns.update(); } public void update(Player player, Position position) -- cgit v1.1-2-g2b99