diff options
-rw-r--r-- | android/assets/data/hud.atlas | 42 | ||||
-rw-r--r-- | android/assets/data/hud.png | bin | 99532 -> 63287 bytes | |||
-rw-r--r-- | assets/hud/enabled.png | bin | 0 -> 224 bytes | |||
-rw-r--r-- | assets/hud/reinforcement-selected.png | bin | 23187 -> 0 bytes | |||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Factory.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/UnitDock.java | 10 |
6 files changed, 26 insertions, 28 deletions
diff --git a/android/assets/data/hud.atlas b/android/assets/data/hud.atlas index d3d84e8..000cdea 100644 --- a/android/assets/data/hud.atlas +++ b/android/assets/data/hud.atlas @@ -1,103 +1,103 @@ hud.png -size: 256,256 +size: 1024,64 format: RGBA8888 filter: Nearest,Nearest repeat: none aps rotate: false - xy: 180, 157 + xy: 452, 3 size: 48, 47 orig: 48, 47 offset: 0, 0 index: -1 attack rotate: false - xy: 68, 2 + xy: 652, 9 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 cancel rotate: false - xy: 138, 107 + xy: 502, 3 size: 48, 47 orig: 48, 47 offset: 0, 0 index: -1 defense rotate: false - xy: 94, 2 + xy: 678, 9 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 disabled rotate: false - xy: 130, 156 + xy: 252, 2 + size: 48, 48 + orig: 48, 48 + offset: 0, 0 + index: -1 +enabled + rotate: false + xy: 302, 2 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 ge-flag rotate: false - xy: 130, 206 + xy: 88, 2 size: 80, 48 orig: 80, 48 offset: 0, 0 index: -1 ok rotate: false - xy: 188, 108 + xy: 552, 3 size: 48, 47 orig: 48, 47 offset: 0, 0 index: -1 options rotate: false - xy: 138, 58 + xy: 602, 3 size: 48, 47 orig: 48, 47 offset: 0, 0 index: -1 promote rotate: false - xy: 88, 78 + xy: 352, 2 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 reinforcement rotate: false - xy: 84, 28 + xy: 402, 2 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 -reinforcement-selected - rotate: false - xy: 2, 128 - size: 126, 126 - orig: 126, 126 - offset: 0, 0 - index: -1 stars rotate: false - xy: 2, 11 + xy: 652, 35 size: 64, 15 orig: 64, 15 offset: 0, 0 index: -1 turns rotate: false - xy: 2, 78 + xy: 2, 2 size: 84, 48 orig: 84, 48 offset: 0, 0 index: -1 us-flag rotate: false - xy: 2, 28 + xy: 170, 2 size: 80, 48 orig: 80, 48 offset: 0, 0 diff --git a/android/assets/data/hud.png b/android/assets/data/hud.png Binary files differindex 0682f0c..72448be 100644 --- a/android/assets/data/hud.png +++ b/android/assets/data/hud.png diff --git a/assets/hud/enabled.png b/assets/hud/enabled.png Binary files differnew file mode 100644 index 0000000..0030817 --- /dev/null +++ b/assets/hud/enabled.png diff --git a/assets/hud/reinforcement-selected.png b/assets/hud/reinforcement-selected.png Binary files differdeleted file mode 100644 index 07162df..0000000 --- a/assets/hud/reinforcement-selected.png +++ /dev/null diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java index a2e898b..a16fb49 100644 --- a/core/src/ch/asynk/rustanddust/game/Factory.java +++ b/core/src/ch/asynk/rustanddust/game/Factory.java @@ -26,8 +26,8 @@ public class Factory implements Board.TileBuilder, Disposable public static final String ACT_PROMOTE = "promote"; public static final String ACT_OPTIONS = "options"; public static final String DISABLED = "disabled"; + public static final String ENABLED = "enabled"; public static final String REINFORCEMENT = "reinforcement"; - public static final String REINFORCEMENT_SELECTED = "reinforcement-selected"; public enum MapType { 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); |