diff --git a/android/assets/foespritesheet.atlas b/android/assets/foespritesheet.atlas deleted file mode 100755 index ed5136c..0000000 --- a/android/assets/foespritesheet.atlas +++ /dev/null @@ -1,22 +0,0 @@ - -foespritesheet.png -size: 512, 512 -format: RGBA8888 -filter: Linear,Linear -repeat: none -bar-beat - rotate: false - xy: 1, 1 - size: 2, 4 - split: 1, 1, 0, 0 - orig: 2, 4 - offset: 0, 0 - index: -1 -black-hole - rotate: false - xy: 4, 1 - size: 3, 3 - split: 1, 1, 1, 1 - orig: 3, 3 - offset: 0, 0 - index: -1 \ No newline at end of file diff --git a/android/assets/foespritesheet.png b/android/assets/foespritesheet.png deleted file mode 100755 index 5f6555b..0000000 Binary files a/android/assets/foespritesheet.png and /dev/null differ diff --git a/android/assets/uiskin.atlas b/android/assets/uiskin.atlas index 0fab7e0..61aca74 100755 --- a/android/assets/uiskin.atlas +++ b/android/assets/uiskin.atlas @@ -318,4 +318,20 @@ large-pane split: 4, 4, 13, 13 orig: 9, 27 offset: 0, 0 + index: -1 +grad-dark-light + rotate: false + xy: 26, 7 + size: 3, 3 + split: 0, 0, 0, 0 + orig: 3, 3 + offset: 0, 0 + index: -1 +grad-light-dark + rotate: false + xy: 30, 7 + size: 3, 3 + split: 0, 0, 0, 0 + orig: 3, 3 + offset: 0, 0 index: -1 \ No newline at end of file diff --git a/android/assets/uiskin.png b/android/assets/uiskin.png index 1313bd8..98d16ec 100755 Binary files a/android/assets/uiskin.png and b/android/assets/uiskin.png differ diff --git a/core/src/zero1hd/polyjet/screens/GameScreen.java b/core/src/zero1hd/polyjet/screens/GameScreen.java index 3bea307..ff8a6e3 100755 --- a/core/src/zero1hd/polyjet/screens/GameScreen.java +++ b/core/src/zero1hd/polyjet/screens/GameScreen.java @@ -43,7 +43,7 @@ public class GameScreen extends ScreenAdapter { gameArea = new GamePlayArea(polyJet.getAssetManager(), core.getPrefs()); gameArea.setAudioMap(gpm); - gameHUD = new GameHUD(polyJet.getDefaultSkin(), gpm.getPlayableClip(), gameArea.getMaxHealth()); + gameHUD = new GameHUD(polyJet.getDefaultSkin(), gpm.getPlayableClip(), gameArea.getMaxHealth(), gameArea.getViewport().getLeftGutterWidth(), gameArea.getViewport().getRightGutterWidth()); inputs = new InputMultiplexer(); inputs.addProcessor(gameHUD); @@ -64,10 +64,8 @@ public class GameScreen extends ScreenAdapter { @Override public void render(float delta) { - Gdx.gl.glClearColor(1f, 1f, 1f, 1f); + Gdx.gl.glClearColor(0f, 0f, 0f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); -// Gdx.gl.glLineWidth(1f); - gameArea.getViewport().apply(); gameArea.draw(); diff --git a/core/src/zero1hd/polyjet/ui/builders/HealthBar.java b/core/src/zero1hd/polyjet/ui/builders/HealthBar.java index 5a7a59a..f5c97ed 100755 --- a/core/src/zero1hd/polyjet/ui/builders/HealthBar.java +++ b/core/src/zero1hd/polyjet/ui/builders/HealthBar.java @@ -17,8 +17,8 @@ public class HealthBar extends WidgetGroup { empty = new Image(skin.getPatch("bar-empty")); filled = new Image(skin.getPatch("bar-fill")); - addActor(empty); addActor(filled); + addActor(empty); this.maxHealth = maxHealth; diff --git a/core/src/zero1hd/polyjet/ui/stages/GameHUD.java b/core/src/zero1hd/polyjet/ui/stages/GameHUD.java index 5c4cb85..b80f19f 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GameHUD.java +++ b/core/src/zero1hd/polyjet/ui/stages/GameHUD.java @@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.g2d.NinePatch; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; @@ -25,10 +26,18 @@ public class GameHUD extends Stage { private Music music; - public GameHUD(Skin skin, Music music, int maxHealth) { + private int leftLetterBox, rightLetterBox; + private NinePatch leftPatch, rightPatch; + public GameHUD(Skin skin, Music music, int maxHealth, int leftLetterBox, int rightLetterBox) { super(); this.music = music; + this.leftLetterBox = leftLetterBox; + this.rightLetterBox = rightLetterBox; + + leftPatch = skin.getPatch("grad-dark-light"); + rightPatch = skin.getPatch("grad-light-dark"); + score = new Label("Score: 0", skin, "default-font", Color.WHITE); score.setPosition(10f, Gdx.graphics.getHeight()-score.getHeight() - 10f); addActor(score); @@ -47,7 +56,6 @@ public class GameHUD extends Stage { fpsWindow = new FPSWindow("FPS", skin); fpsWindow.setPosition(15f, 15f); - addActor(fpsWindow); pauseMenu = new PauseMenu(skin); pauseMenu.getResumeButton().addListener(new ChangeListener() { @@ -113,7 +121,11 @@ public class GameHUD extends Stage { public boolean keyUp(int keycode) { switch (keycode) { case Keys.F3: - addActor(fpsWindow); + if (fpsWindow.hasParent()) { + fpsWindow.remove(); + } else { + addActor(fpsWindow); + } break; case Keys.ESCAPE: togglePause(); @@ -123,4 +135,13 @@ public class GameHUD extends Stage { } return false; } + + @Override + public void draw() { + getBatch().begin(); + leftPatch.draw(getBatch(), 0, 0, leftLetterBox, Gdx.graphics.getHeight()); + rightPatch.draw(getBatch(), Gdx.graphics.getWidth()-rightLetterBox, 0, rightLetterBox, Gdx.graphics.getHeight()); + getBatch().end(); + super.draw(); + } }