diff options
-rw-r--r-- | android/assets/data/hud.atlas | 66 | ||||
-rw-r--r-- | android/assets/data/hud.png | bin | 106219 -> 62948 bytes | |||
-rw-r--r-- | android/assets/data/ui.atlas | 50 | ||||
-rw-r--r-- | android/assets/data/ui.png | bin | 0 -> 37837 bytes | |||
-rw-r--r-- | assets/build.gradle | 12 | ||||
-rw-r--r-- | assets/ui/cancel.png (renamed from assets/hud/cancel.png) | bin | 5502 -> 5502 bytes | |||
-rw-r--r-- | assets/ui/disabled.png (renamed from assets/hud/disabled.png) | bin | 223 -> 223 bytes | |||
-rw-r--r-- | assets/ui/ok.png (renamed from assets/hud/ok.png) | bin | 5724 -> 5724 bytes | |||
-rw-r--r-- | assets/ui/typewriter.9.png (renamed from assets/hud/typewriter.9.png) | bin | 4780 -> 4780 bytes | |||
-rw-r--r-- | assets/ui/veteran-black.png (renamed from assets/hud/veteran-black.png) | bin | 8980 -> 8980 bytes | |||
-rw-r--r-- | assets/ui/veteran-white.png (renamed from assets/hud/veteran-white.png) | bin | 9306 -> 9306 bytes | |||
-rw-r--r-- | core/src/ch/asynk/tankontank/TankOnTank.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 19 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/ActionButtons.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Engagement.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java | 14 |
16 files changed, 104 insertions, 83 deletions
diff --git a/android/assets/data/hud.atlas b/android/assets/data/hud.atlas index 85e1c2e..4db9648 100644 --- a/android/assets/data/hud.atlas +++ b/android/assets/data/hud.atlas @@ -1,120 +1,76 @@ hud.png -size: 512,512 +size: 256,256 format: RGBA8888 filter: Nearest,Nearest repeat: none aps rotate: false - xy: 370, 462 + xy: 2, 28 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 attack rotate: false - xy: 324, 358 + xy: 68, 2 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 -cancel - rotate: false - xy: 2, 19 - size: 48, 48 - orig: 48, 48 - offset: 0, 0 - index: -1 defense rotate: false - xy: 102, 43 + xy: 94, 2 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 -disabled - rotate: false - xy: 84, 69 - size: 48, 48 - orig: 48, 48 - offset: 0, 0 - index: -1 ge-flag rotate: false - xy: 2, 69 + xy: 2, 78 size: 80, 48 orig: 80, 48 offset: 0, 0 index: -1 -ok - rotate: false - xy: 52, 19 - size: 48, 48 - orig: 48, 48 - offset: 0, 0 - index: -1 promote rotate: false - xy: 242, 284 + xy: 130, 156 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 reinforcement rotate: false - xy: 370, 412 + xy: 84, 78 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 reinforcement-selected rotate: false - xy: 242, 384 + xy: 2, 128 size: 126, 126 orig: 126, 126 offset: 0, 0 index: -1 stars rotate: false - xy: 2, 2 + xy: 2, 11 size: 64, 15 orig: 64, 15 offset: 0, 0 index: -1 turns rotate: false - xy: 420, 462 - size: 48, 48 - orig: 48, 48 - offset: 0, 0 - index: -1 -typewriter - rotate: false - xy: 134, 69 + xy: 52, 28 size: 48, 48 - split: 23, 23, 23, 23 - pad: 11, 11, 12, 12 orig: 48, 48 offset: 0, 0 index: -1 us-flag rotate: false - xy: 242, 334 + xy: 130, 206 size: 80, 48 orig: 80, 48 offset: 0, 0 index: -1 -veteran-black - rotate: false - xy: 2, 119 - size: 118, 391 - orig: 118, 391 - offset: 0, 0 - index: -1 -veteran-white - rotate: false - xy: 122, 119 - size: 118, 391 - orig: 118, 391 - offset: 0, 0 - index: -1 diff --git a/android/assets/data/hud.png b/android/assets/data/hud.png Binary files differindex 0d3ce28..04ee5be 100644 --- a/android/assets/data/hud.png +++ b/android/assets/data/hud.png diff --git a/android/assets/data/ui.atlas b/android/assets/data/ui.atlas new file mode 100644 index 0000000..905d26f --- /dev/null +++ b/android/assets/data/ui.atlas @@ -0,0 +1,50 @@ + +ui.png +size: 256,512 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +cancel + rotate: false + xy: 2, 52 + size: 48, 48 + orig: 48, 48 + offset: 0, 0 + index: -1 +disabled + rotate: false + xy: 2, 2 + size: 48, 48 + orig: 48, 48 + offset: 0, 0 + index: -1 +ok + rotate: false + xy: 52, 52 + size: 48, 48 + orig: 48, 48 + offset: 0, 0 + index: -1 +typewriter + rotate: false + xy: 52, 2 + size: 48, 48 + split: 23, 23, 23, 23 + pad: 11, 11, 12, 12 + orig: 48, 48 + offset: 0, 0 + index: -1 +veteran-black + rotate: false + xy: 2, 102 + size: 118, 391 + orig: 118, 391 + offset: 0, 0 + index: -1 +veteran-white + rotate: false + xy: 122, 102 + size: 118, 391 + orig: 118, 391 + offset: 0, 0 + index: -1 diff --git a/android/assets/data/ui.png b/android/assets/data/ui.png Binary files differnew file mode 100644 index 0000000..af01d0e --- /dev/null +++ b/android/assets/data/ui.png diff --git a/assets/build.gradle b/assets/build.gradle index 808ae80..674c38a 100644 --- a/assets/build.gradle +++ b/assets/build.gradle @@ -30,6 +30,18 @@ task copySounds(type: Copy) { into '../android/assets/sounds' } +task packUi(type: JavaExec) { + main = 'com.badlogic.gdx.tools.texturepacker.TexturePacker' + classpath = configurations.texturePacker + args = ['../assets/ui', '../android/assets/data', 'ui'] +} + +task packMenu(type: JavaExec) { + main = 'com.badlogic.gdx.tools.texturepacker.TexturePacker' + classpath = configurations.texturePacker + args = ['../assets/menu', '../android/assets/data', 'menu'] +} + task packHud(type: JavaExec) { main = 'com.badlogic.gdx.tools.texturepacker.TexturePacker' classpath = configurations.texturePacker diff --git a/assets/hud/cancel.png b/assets/ui/cancel.png Binary files differindex a5b3d99..a5b3d99 100644 --- a/assets/hud/cancel.png +++ b/assets/ui/cancel.png diff --git a/assets/hud/disabled.png b/assets/ui/disabled.png Binary files differindex 70cc80b..70cc80b 100644 --- a/assets/hud/disabled.png +++ b/assets/ui/disabled.png diff --git a/assets/hud/ok.png b/assets/ui/ok.png Binary files differindex fa8cbf6..fa8cbf6 100644 --- a/assets/hud/ok.png +++ b/assets/ui/ok.png diff --git a/assets/hud/typewriter.9.png b/assets/ui/typewriter.9.png Binary files differindex a2fbc8c..a2fbc8c 100644 --- a/assets/hud/typewriter.9.png +++ b/assets/ui/typewriter.9.png diff --git a/assets/hud/veteran-black.png b/assets/ui/veteran-black.png Binary files differindex ea5fcbe..ea5fcbe 100644 --- a/assets/hud/veteran-black.png +++ b/assets/ui/veteran-black.png diff --git a/assets/hud/veteran-white.png b/assets/ui/veteran-white.png Binary files differindex daa70d9..daa70d9 100644 --- a/assets/hud/veteran-white.png +++ b/assets/ui/veteran-white.png diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java index d1a3fb8..2e081fb 100644 --- a/core/src/ch/asynk/tankontank/TankOnTank.java +++ b/core/src/ch/asynk/tankontank/TankOnTank.java @@ -48,6 +48,7 @@ public class TankOnTank extends Game manager.load("data/map_a.png", Texture.class); manager.load("data/map_b.png", Texture.class); manager.load("data/hex.png", Texture.class); + manager.load("data/ui.atlas", TextureAtlas.class); manager.load("data/hud.atlas", TextureAtlas.class); manager.load("data/units.atlas", TextureAtlas.class); manager.load("data/unit-overlays.atlas", TextureAtlas.class); @@ -73,6 +74,7 @@ public class TankOnTank extends Game manager.unload("data/map_a.png"); manager.unload("data/map_b.png"); manager.unload("data/hex.png"); + manager.unload("data/ui.atlas"); manager.unload("data/hud.atlas"); manager.unload("data/units.atlas"); manager.unload("data/unit-overlays.atlas"); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 6b7b8a6..c72ae91 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -50,16 +50,17 @@ public class Hud implements Disposable, Animation this.game = game; this.ctrl = ctrl; - TextureAtlas atlas = game.factory.hudAtlas; - fontB = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), atlas.findRegion("veteran-black")); - fontW = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), atlas.findRegion("veteran-white")); - playerInfo = new PlayerInfo(ctrl, fontW, atlas); - actionButtons = new ActionButtons(ctrl, atlas); + TextureAtlas hudAtlas = game.factory.hudAtlas; + TextureAtlas uiAtlas = game.manager.get("data/ui.atlas", TextureAtlas.class); + fontB = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), uiAtlas.findRegion("veteran-black")); + fontW = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), uiAtlas.findRegion("veteran-white")); + playerInfo = new PlayerInfo(ctrl, fontW, uiAtlas, hudAtlas); + actionButtons = new ActionButtons(ctrl, uiAtlas, hudAtlas); actionButtons.hide(); - msg = new Msg(fontB, atlas); - okCancel = new OkCancel(fontB, atlas); - stats = new Statistics(fontB, atlas); - engagement = new Engagement(fontB, atlas); + msg = new Msg(fontB, uiAtlas); + okCancel = new OkCancel(fontB, uiAtlas); + stats = new Statistics(fontB, uiAtlas); + engagement = new Engagement(fontB, uiAtlas, hudAtlas); } @Override diff --git a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java index ff9034e..17402f0 100644 --- a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java +++ b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java @@ -40,9 +40,9 @@ public class ActionButtons extends Widget private StateType states []; private Position position; - public ActionButtons(Ctrl ctrl, TextureAtlas atlas) + public ActionButtons(Ctrl ctrl, TextureAtlas uiAtlas, TextureAtlas hudAtlas) { - this.bg = new Sprite(atlas.findRegion("disabled")); + this.bg = new Sprite(uiAtlas.findRegion("disabled")); this.ctrl = ctrl; this.visible = false; this.position = Position.BOTTOM_RIGHT; @@ -50,9 +50,9 @@ public class ActionButtons extends Widget this.buttons = new Bg[Buttons.LAST.i]; - this.buttons[Buttons.DONE.i] = new Bg(atlas.findRegion("ok")); - this.buttons[Buttons.ABORT.i] = new Bg(atlas.findRegion("cancel")); - this.buttons[Buttons.PROMOTE.i] = new Bg(atlas.findRegion("promote")); + this.buttons[Buttons.DONE.i] = new Bg(uiAtlas.findRegion("ok")); + this.buttons[Buttons.ABORT.i] = new Bg(uiAtlas.findRegion("cancel")); + this.buttons[Buttons.PROMOTE.i] = new Bg(hudAtlas.findRegion("promote")); this.states = new StateType[Buttons.LAST.i]; this.states[Buttons.DONE.i] = StateType.DONE; diff --git a/core/src/ch/asynk/tankontank/game/hud/Engagement.java b/core/src/ch/asynk/tankontank/game/hud/Engagement.java index 805b7d6..ffbfa65 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Engagement.java +++ b/core/src/ch/asynk/tankontank/game/hud/Engagement.java @@ -44,18 +44,18 @@ public class Engagement extends Patch implements Animation private DiceAnimation d3Animation; private DiceAnimation d4Animation; - public Engagement(BitmapFont font, TextureAtlas atlas) + public Engagement(BitmapFont font, TextureAtlas uiAtlas, TextureAtlas hudAtlas) { - super(atlas.createPatch("typewriter")); - usFlag = new Sprite(atlas.findRegion("us-flag")); - geFlag = new Sprite(atlas.findRegion("ge-flag")); - attackImg = new Sprite(atlas.findRegion("attack")); - defenseImg = new Sprite(atlas.findRegion("defense")); + super(uiAtlas.createPatch("typewriter")); + usFlag = new Sprite(hudAtlas.findRegion("us-flag")); + geFlag = new Sprite(hudAtlas.findRegion("ge-flag")); + attackImg = new Sprite(hudAtlas.findRegion("attack")); + defenseImg = new Sprite(hudAtlas.findRegion("defense")); this.attack = new Label(font); this.defense = new Label(font); this.attackR = new Label(font); this.defenseR = new Label(font); - this.okBtn = new Bg(atlas.findRegion("ok")); + this.okBtn = new Bg(uiAtlas.findRegion("ok")); this.visible = false; this.d1Animation = new DiceAnimation(); this.d2Animation = new DiceAnimation(); diff --git a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java index 6125517..24f07b8 100644 --- a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java @@ -37,16 +37,16 @@ public class PlayerInfo implements Disposable, Drawable, Animation public UnitDock unitDock; private Position position; - public PlayerInfo(Ctrl ctrl, BitmapFont font, TextureAtlas atlas) + public PlayerInfo(Ctrl ctrl, BitmapFont font, TextureAtlas uiAtlas, TextureAtlas hudAtlas) { this.ctrl = ctrl; this.position = Position.MIDDLE_CENTER; - 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); - unitDock = new UnitDock(ctrl, atlas.findRegion("disabled"), atlas.findRegion("reinforcement-selected"), 10f); + usFlag = new Sprite(hudAtlas.findRegion("us-flag")); + geFlag = new Sprite(hudAtlas.findRegion("ge-flag")); + turns = new LabelImage(hudAtlas.findRegion("turns"), font, 5f); + aps = new LabelImage(hudAtlas.findRegion("aps"), font, 5f); + reinforcement = new LabelImage(hudAtlas.findRegion("reinforcement"), font, 5f); + unitDock = new UnitDock(ctrl, uiAtlas.findRegion("disabled"), hudAtlas.findRegion("reinforcement-selected"), 10f); } @Override |