From ef50c03a3025738f7cd6b426c857c470ce8480c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 19 Nov 2014 10:21:52 +0100 Subject: PlayerInfo: use Sprite instead of Image --- core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java index 6bee17e..dc0c195 100644 --- a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java @@ -3,13 +3,12 @@ package ch.asynk.tankontank.game.hud; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; -// TODO replace with Sprite !! import ch.asynk.tankontank.engine.gfx.Drawable; -import ch.asynk.tankontank.engine.gfx.Image; import ch.asynk.tankontank.game.State.StateType; import ch.asynk.tankontank.game.Ctrl; @@ -25,9 +24,9 @@ public class PlayerInfo implements Disposable, Drawable private Object hit; private float padding; - private Image flag; - private Image usFlag; - private Image geFlag; + private Sprite flag; + private Sprite usFlag; + private Sprite geFlag; private LabelImage turns; private LabelImage aps; private LabelImage reinforcement; @@ -37,8 +36,8 @@ public class PlayerInfo implements Disposable, Drawable { this.ctrl = ctrl; this.padding = padding; - usFlag = new Image(atlas.findRegion("us-flag")); - geFlag = new Image(atlas.findRegion("ge-flag")); + usFlag = new Sprite(atlas.findRegion("us-flag")); + geFlag = new Sprite(atlas.findRegion("ge-flag")); turns = new LabelImage(atlas.findRegion("turns"), font, 5f); aps = new LabelImage(atlas.findRegion("aps"), font, 5f); reinforcement = new LabelImage(atlas.findRegion("reinforcement"), font, 5f); @@ -48,8 +47,6 @@ public class PlayerInfo implements Disposable, Drawable @Override public void dispose() { - usFlag.dispose(); - geFlag.dispose(); turns.dispose(); aps.dispose(); reinforcement.dispose(); @@ -171,10 +168,10 @@ public class PlayerInfo implements Disposable, Drawable @Override public void drawDebug(ShapeRenderer debugShapes) { - flag.drawDebug(debugShapes); turns.drawDebug(debugShapes); aps.drawDebug(debugShapes); reinforcement.drawDebug(debugShapes); unitDock.drawDebug(debugShapes); + debugShapes.rect(flag.getX(), flag.getY(), flag.getWidth(), flag.getHeight()); } } -- cgit v1.1-2-g2b99