summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-19 10:21:52 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-19 10:21:52 +0100
commitef50c03a3025738f7cd6b426c857c470ce8480c8 (patch)
tree1d39c3fb07e18a97ddb55ad1d644959fa706074b /core/src/ch
parentd2737a89a46694622e9206ac1704f23f9601d2ef (diff)
downloadRustAndDust-ef50c03a3025738f7cd6b426c857c470ce8480c8.zip
RustAndDust-ef50c03a3025738f7cd6b426c857c470ce8480c8.tar.gz
PlayerInfo: use Sprite instead of Image
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java17
1 files 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());
}
}