diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-04 15:22:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-01-04 15:22:58 +0100 |
commit | fc2ea1292a302417053036b23e433d0c0645e3d3 (patch) | |
tree | ac677e5b6ce4ca38b6413e1338633de7e77c91cd /core/src/ch/asynk/rustanddust/game/hud | |
parent | 821ec7c94332c29308e7aef671935ac427ecda07 (diff) | |
download | RustAndDust-fc2ea1292a302417053036b23e433d0c0645e3d3.zip RustAndDust-fc2ea1292a302417053036b23e433d0c0645e3d3.tar.gz |
UnitDock: replace selected red border with light grey Bg
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/hud')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/UnitDock.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java index 7b9e5f9..d63b66c 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java +++ b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java @@ -3,7 +3,6 @@ package ch.asynk.rustanddust.game.hud; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.Matrix4; @@ -36,7 +35,7 @@ public class UnitDock extends Bg implements Animation private boolean show; private boolean mvtDone; public Unit selectedUnit; - private Sprite selected; + private Bg selected; private UnitList units; private Vector3 point; private Matrix4 saved; @@ -55,7 +54,7 @@ public class UnitDock extends Bg implements Animation this.transform = new Matrix4(); this.scaledRect = new Rectangle(); this.scissors = new Rectangle(); - this.selected = new Sprite(game.factory.getHudRegion(game.factory.REINFORCEMENT_SELECTED)); + this.selected = new Bg(game.factory.getHudRegion(game.factory.ENABLED)); this.visible = false; this.dx = 0f; this.dy = 0f; @@ -122,7 +121,7 @@ public class UnitDock extends Bg implements Animation { int i = (int) ((scaledRect.y + scaledRect.height - y) / (scaledRect.height / units.size())); selectedUnit = units.get(i); - selected.setCenter((selectedUnit.getX() + (selectedUnit.getWidth() / 2)), (selectedUnit.getY() + (selectedUnit.getHeight() / 2))); + selected.setPosition(selectedUnit.getX() - padding, selectedUnit.getY() - padding, selectedUnit.getWidth() + (2 * padding), selectedUnit.getHeight() + (2 * padding)); return selectedUnit; } @@ -239,9 +238,8 @@ public class UnitDock extends Bg implements Animation Gdx.gl.glScissor((int)scissors.x, (int)scissors.y, (int)scissors.width, (int)scissors.height); super.draw(batch); - for (Unit unit : units) unit.draw(batch); - if (selectedUnit != null) selected.draw(batch); + for (Unit unit : units) unit.draw(batch); batch.setTransformMatrix(saved); |