diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-30 11:21:04 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-30 11:21:04 +0200 |
commit | 3c3a3a2bf261462221d456ebab6ba568713c144e (patch) | |
tree | 7c416912d73689850c0a632be5a1af830cf2f5b1 /test/src/ch | |
parent | 25b5f54ddbc6c0e3dd3b8ca461a0ed118e1421cf (diff) | |
download | gdx-boardgame-3c3a3a2bf261462221d456ebab6ba568713c144e.zip gdx-boardgame-3c3a3a2bf261462221d456ebab6ba568713c144e.tar.gz |
GameHud : no more updates
Diffstat (limited to 'test/src/ch')
-rw-r--r-- | test/src/ch/asynk/gdx/board/test/GameHud.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/src/ch/asynk/gdx/board/test/GameHud.java b/test/src/ch/asynk/gdx/board/test/GameHud.java index d3495c5..f401bf9 100644 --- a/test/src/ch/asynk/gdx/board/test/GameHud.java +++ b/test/src/ch/asynk/gdx/board/test/GameHud.java @@ -4,6 +4,8 @@ import java.util.function.Supplier; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Sprite; +import com.badlogic.gdx.graphics.g2d.NinePatch; +import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.utils.Disposable; @@ -27,14 +29,17 @@ public class GameHud implements Disposable, Touchable this.nextState = nextState; this.corner = new Sprite(assets.getTexture(assets.CORNER)); + NinePatch patch = assets.getNinePatch(assets.PATCH, 23, 23, 23 ,23); + BitmapFont font = assets.getFont(assets.FONT_25); + this.root = new Root(2); this.root.setPadding(30); - this.hello = new Button(assets.getFont(assets.FONT_25), assets.getNinePatch(assets.PATCH, 23, 23, 23 ,23), 10, 15); + this.hello = new Button(font, patch, 10, 15); this.hello.write("Hello"); this.root.add(this.hello); - this.next = new Button(assets.getFont(assets.FONT_25), assets.getNinePatch(assets.PATCH, 23, 23, 23 ,23), 20, 0); + this.next = new Button(font, patch, 20); this.next.write("NEXT"); this.next.setPosition(50, 50); this.next.setAlignment(Alignment.MIDDLE_CENTER); @@ -84,7 +89,6 @@ public class GameHud implements Disposable, Touchable { this.next.setPosition(p, p); this.next.setAlignment(a); - this.next.update(); } public void draw(Batch batch) @@ -127,12 +131,11 @@ public class GameHud implements Disposable, Touchable { hello.setAlignment(Alignment.TOP_LEFT); hello.setLabelAlignment(Alignment.BOTTOM_RIGHT); - hello.update(); root.draw(batch); 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_CENTER, Alignment.MIDDLE_CENTER); drawHello(batch, Alignment.MIDDLE_RIGHT, Alignment.MIDDLE_LEFT); drawHello(batch, Alignment.BOTTOM_LEFT, Alignment.TOP_RIGHT); drawHello(batch, Alignment.BOTTOM_CENTER, Alignment.TOP_CENTER); @@ -143,7 +146,6 @@ public class GameHud implements Disposable, Touchable { hello.setAlignment(alignment1); hello.setLabelAlignment(alignment2); - hello.update(); hello.draw(batch); } |