summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-12 20:46:03 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-12 20:46:03 +0200
commitc024fc9eef6959f630ad29e4ed1a2570fdc2bc55 (patch)
tree765a918ba296b6b8d4e81653f1b484c6cb627c75
parent4488edb4714fdff9509c967b74530d54d1fc1fb8 (diff)
downloadgdx-boardgame-c024fc9eef6959f630ad29e4ed1a2570fdc2bc55.zip
gdx-boardgame-c024fc9eef6959f630ad29e4ed1a2570fdc2bc55.tar.gz
GameHud : change element layout
-rw-r--r--core/src/ch/asynk/zproject/GameHud.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/core/src/ch/asynk/zproject/GameHud.java b/core/src/ch/asynk/zproject/GameHud.java
index 25b349b..4d0cc01 100644
--- a/core/src/ch/asynk/zproject/GameHud.java
+++ b/core/src/ch/asynk/zproject/GameHud.java
@@ -35,7 +35,9 @@ public class GameHud implements Disposable, Touchable
this.next = new Button(assets.getFont(assets.FONT_25), assets.getNinePatch(assets.PATCH, 23, 23, 23 ,23), 20, 0);
this.next.write("NEXT");
- this.next.setPosition(100, 100);
+ this.next.setPosition(50, 50);
+ this.next.setAlignment(Alignment.MIDDLE_CENTER);
+ this.next.setLabelAlignment(Alignment.MIDDLE_CENTER);
this.root.add(this.next);
}
@@ -88,17 +90,17 @@ public class GameHud implements Disposable, Touchable
private void drawButtons(Batch batch)
{
hello.setAlignment(Alignment.TOP_LEFT);
- hello.setLabelAlignment(Alignment.BOTTOM_CENTER);
+ hello.setLabelAlignment(Alignment.BOTTOM_RIGHT);
hello.update();
root.draw(batch);
- drawHello(batch, Alignment.TOP_CENTER, Alignment.BOTTOM_RIGHT);
- drawHello(batch, Alignment.TOP_RIGHT, Alignment.TOP_LEFT);
- drawHello(batch, Alignment.MIDDLE_LEFT, Alignment.TOP_CENTER);
- drawHello(batch, Alignment.MIDDLE_CENTER, Alignment.TOP_RIGHT);
+ drawHello(batch, Alignment.TOP_CENTER, Alignment.BOTTOM_CENTER);
+ drawHello(batch, Alignment.TOP_RIGHT, Alignment.BOTTOM_LEFT);
+ drawHello(batch, Alignment.MIDDLE_LEFT, Alignment.MIDDLE_RIGHT);
+ // drawHello(batch, Alignment.MIDDLE_CENTER, Alignment.MIDDLE_CENTER);
drawHello(batch, Alignment.MIDDLE_RIGHT, Alignment.MIDDLE_LEFT);
- drawHello(batch, Alignment.BOTTOM_LEFT, Alignment.MIDDLE_CENTER);
- drawHello(batch, Alignment.BOTTOM_CENTER, Alignment.MIDDLE_RIGHT);
- drawHello(batch, Alignment.BOTTOM_RIGHT, Alignment.BOTTOM_LEFT);
+ drawHello(batch, Alignment.BOTTOM_LEFT, Alignment.TOP_RIGHT);
+ drawHello(batch, Alignment.BOTTOM_CENTER, Alignment.TOP_CENTER);
+ drawHello(batch, Alignment.BOTTOM_RIGHT, Alignment.TOP_LEFT);
}
private void drawHello(Batch batch, Alignment alignment1, Alignment alignment2)