diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-10 17:26:36 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-10 17:26:36 +0100 |
commit | db73f9bae67250461bda763840fcffc44eb4bf85 (patch) | |
tree | d7c98faa3a64e5bd6c1d6c3492282691b01552ae | |
parent | cb614227436013ea629bdf5aba221c76af5c1cbc (diff) | |
download | RustAndDust-db73f9bae67250461bda763840fcffc44eb4bf85.zip RustAndDust-db73f9bae67250461bda763840fcffc44eb4bf85.tar.gz |
ActionButtons: owns padding
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/ActionButtons.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java index 707a833..b8a19c4 100644 --- a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java +++ b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java @@ -9,6 +9,8 @@ import ch.asynk.tankontank.game.State.StateType; public class ActionButtons extends Bg { + public static int PADDING = 20; + private final Ctrl ctrl; public enum Buttons { @@ -28,17 +30,15 @@ public class ActionButtons extends Bg public int b; } - public float padding; private int idx; private Bg buttons []; private StateType states []; private Position position; - public ActionButtons(Ctrl ctrl, TextureAtlas atlas, float padding) + public ActionButtons(Ctrl ctrl, TextureAtlas atlas) { super(atlas.findRegion("disabled")); this.ctrl = ctrl; - this.padding = padding; this.visible = false; this.position = Position.BOTTOM_RIGHT; this.idx = Buttons.NONE.i; @@ -79,7 +79,7 @@ public class ActionButtons extends Bg { btn.visible = true; btn.setPosition(x, y); - return (y + btn.getHeight() + padding); + return (y + btn.getHeight() + PADDING); } public void show(int bits) @@ -97,13 +97,13 @@ public class ActionButtons extends Bg return; } - rect.width = (buttons[0].getWidth() + (2 * padding)); - rect.height = ((buttons[0].getHeight() * count) + ((count + 1) * padding)); + rect.width = (buttons[0].getWidth() + (2 * PADDING)); + rect.height = ((buttons[0].getHeight() * count) + ((count + 1) * PADDING)); rect.x = position.getX(rect.width); rect.y = position.getY(rect.height); - float x = (rect.x + padding); - float y = (rect.y + padding); + float x = (rect.x + PADDING); + float y = (rect.y + PADDING); b = 1; for (int i = 0; i < Buttons.LAST.i; i++) { |