summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
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
parentabd0ea69183a36c6a3e818edcdc1883a97be8b3a (diff)
downloadRustAndDust-ebad96ed8891d129824b53dca622e77a6fe40341.zip
RustAndDust-ebad96ed8891d129824b53dca622e77a6fe40341.tar.gz
Option menus: repalce VSPACING with LABEL_PADDING
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java27
-rw-r--r--core/src/ch/asynk/rustanddust/menu/OptionsMenu.java30
2 files changed, 28 insertions, 29 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);
diff --git a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
index e3ff8cf..6916714 100644
--- a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
+++ b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
@@ -14,8 +14,8 @@ public class OptionsMenu extends Patch
{
public static int PADDING = 30;
public static int OPT_PADDING = 10;
- public static int TITLE_PADDING = 20;
- public static int VSPACING = 5;
+ public static int TITLE_PADDING = 10;
+ public static int LABEL_PADDING = 10;
public static int HSPACING = 30;
public static String CHECK = "#";
@@ -51,18 +51,18 @@ public class OptionsMenu extends Patch
this.font = game.font;
this.okBtn = new Bg(game.getUiRegion(game.UI_OK));
this.cancelBtn = new Bg(game.getUiRegion(game.UI_CANCEL));
- this.title = new Label(font, 5f);
+ this.title = new Label(font, LABEL_PADDING);
this.title.write("- Options");
- this.fxVolume = new Label(font, 5f);
+ this.fxVolume = new Label(font, LABEL_PADDING);
this.fxVolume.write("Fx Volume");
- this.fxVolumeValue = new Label(font, 5f);
- this.graphics = new Label(font, 5f);
+ this.fxVolumeValue = new Label(font, LABEL_PADDING);
+ this.graphics = new Label(font, LABEL_PADDING);
this.graphics.write("Graphics");
- this.graphicsValue = new Label(font, 5f);
+ this.graphicsValue = new Label(font, LABEL_PADDING);
this.checkValues = new boolean[checkStrings.length];
this.checkLabels = new Label[checkStrings.length];
for (int i = 0; i < checkLabels.length; i++) {
- Label l = new Label(font, 5f);
+ Label l = new Label(font, LABEL_PADDING);
l.write(checkStrings[i]);
this.checkLabels[i] = l;
}
@@ -114,11 +114,11 @@ public class OptionsMenu extends Patch
public void setPosition()
{
- float h = (title.getHeight() + TITLE_PADDING + ((checkLabels.length - 1) * VSPACING) + (2 * PADDING));
+ float h = (title.getHeight() + TITLE_PADDING + (2 * PADDING));
for (int i = 0; i < checkLabels.length; i++)
h += checkLabels[i].getHeight();
- h += (graphics.getHeight() + VSPACING);
- h += (fxVolume.getHeight() + VSPACING);
+ h += graphics.getHeight();
+ h += fxVolume.getHeight();
float w = title.getWidth();
for (int i = 0; i < checkLabels.length; i++) {
@@ -140,15 +140,15 @@ public class OptionsMenu extends Patch
graphics.setPosition(x, y);
graphicsValue.setPosition((x + graphics.getWidth() + OPT_PADDING), y);
- y += (VSPACING + graphics.getHeight());
+ y += graphics.getHeight();
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();
}
- y += (TITLE_PADDING - VSPACING);
+ y += TITLE_PADDING;
x -= PADDING;
title.setPosition(x, y);
}