summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-06 22:16:44 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-06 22:16:44 +0100
commitebad96ed8891d129824b53dca622e77a6fe40341 (patch)
tree92f72279f82d7d111206d8bc4bceca38be7429d6 /core/src/ch/asynk/rustanddust/game
parentabd0ea69183a36c6a3e818edcdc1883a97be8b3a (diff)
downloadRustAndDust-ebad96ed8891d129824b53dca622e77a6fe40341.zip
RustAndDust-ebad96ed8891d129824b53dca622e77a6fe40341.tar.gz
Option menus: repalce VSPACING with LABEL_PADDING
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
index 58b2357..c7d8b8e 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
@@ -19,8 +19,8 @@ public class OptionsPanel extends Patch
public static int PADDING = 30;
public static int OPT_PADDING = 10;
- public static int TITLE_PADDING = 20;
- public static int VSPACING = 15;
+ public static int TITLE_PADDING = 5;
+ public static int LABEL_PADDING = 10;
public static int HSPACING = 30;
public static String CHECK = "#";
@@ -40,18 +40,18 @@ public class OptionsPanel extends Patch
super(game.ninePatch);
this.game = game;
this.font = game.font;
- this.title = new Label(game.font, 5f);
+ this.title = new Label(game.font, LABEL_PADDING);
this.title.write("- Options");
- this.fxVolume = new Label(game.font, 5f);
+ this.fxVolume = new Label(game.font, LABEL_PADDING);
this.fxVolume.write("Fx Volume");
- this.fxVolumeValue = new Label(game.font, 5f);
- this.quit = new Label(game.font, 5f);
+ this.fxVolumeValue = new Label(game.font, LABEL_PADDING);
+ this.quit = new Label(game.font, LABEL_PADDING);
this.quit.write("Quit battle");
this.visible = false;
this.checkValues = new boolean[checkStrings.length];
this.checkLabels = new Label[checkStrings.length];
for (int i = 0; i < checkLabels.length; i++) {
- Label l = new Label(game.font, 5f);
+ Label l = new Label(game.font, LABEL_PADDING);
l.write(checkStrings[i]);
this.checkLabels[i] = l;
}
@@ -77,11 +77,10 @@ public class OptionsPanel extends Patch
{
fxVolumeValue.write(fxStrings[0]);
- float h = (title.getHeight() + TITLE_PADDING + fxVolumeValue.getHeight() + VSPACING);
- h += ((checkLabels.length - 1) * VSPACING);
+ float h = (title.getHeight() + TITLE_PADDING + fxVolumeValue.getHeight());
for (int i = 0; i < checkLabels.length; i++)
h += checkLabels[i].getHeight();
- h += (quit.getHeight() + VSPACING);
+ h += quit.getHeight();
h += (2 * PADDING);
float w = (fxVolume.getWidth() + fxVolumeValue.getWidth());
@@ -101,17 +100,17 @@ public class OptionsPanel extends Patch
fxVolume.setPosition(x, y);
fxVolumeValue.setPosition((x + fxVolume.getWidth() + OPT_PADDING), y);
- y += (VSPACING + fxVolume.getHeight());
+ y += fxVolume.getHeight();
for (int i = 0; i < checkLabels.length; i++) {
checkLabels[i].setPosition(x, y);
- y += (VSPACING + checkLabels[i].getHeight());
+ y += checkLabels[i].getHeight();
}
quit.setPosition(x,y);
- y += (VSPACING + quit.getHeight());
+ y += quit.getHeight();
- y += (TITLE_PADDING - VSPACING);
+ y += TITLE_PADDING;
x -= PADDING;
title.setPosition(x, y);