diff --git a/StrafeOverdead/assets/ui/backgrounds/banner.png b/StrafeOverdead/assets/ui/backgrounds/banner.png index 6d0cb84..ad62e67 100644 Binary files a/StrafeOverdead/assets/ui/backgrounds/banner.png and b/StrafeOverdead/assets/ui/backgrounds/banner.png differ diff --git a/StrafeOverdead/core/src/com/strafergame/screens/LoadingScreen.java b/StrafeOverdead/core/src/com/strafergame/screens/LoadingScreen.java index cb9c501..2a518e6 100644 --- a/StrafeOverdead/core/src/com/strafergame/screens/LoadingScreen.java +++ b/StrafeOverdead/core/src/com/strafergame/screens/LoadingScreen.java @@ -79,7 +79,8 @@ public void render(float delta) { shapeRenderer.begin(ShapeType.Filled); shapeRenderer.setColor(Color.valueOf("#40444b")); - shapeRenderer.rect(0, Gdx.graphics.getHeight() / 2f - 435 / 2f, Gdx.graphics.getWidth() * progress, 435); + float height = (Gdx.graphics.getHeight() / 1080f) * 360f; + shapeRenderer.rect(0, Gdx.graphics.getHeight() / 2f - height / 2f, Gdx.graphics.getWidth() * progress, height); shapeRenderer.end(); } diff --git a/StrafeOverdead/core/src/com/strafergame/screens/TitleScreen.java b/StrafeOverdead/core/src/com/strafergame/screens/TitleScreen.java index dc571e1..edabf83 100644 --- a/StrafeOverdead/core/src/com/strafergame/screens/TitleScreen.java +++ b/StrafeOverdead/core/src/com/strafergame/screens/TitleScreen.java @@ -21,15 +21,13 @@ public TitleScreen(Strafer game) { @Override public void resize(int width, int height) { Strafer.uiManager.getViewport().update(width, height, true); + titleMenu.resize(); } @Override public void render(float delta) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - Strafer.spriteBatch.begin(); - Strafer.spriteBatch.draw(Strafer.assetManager.get("ui/backgrounds/banner.png", Texture.class), 0, 0); - Strafer.spriteBatch.end(); Strafer.uiManager.act(delta); Strafer.uiManager.draw(); Strafer.uiManager.setDebugAll(Strafer.inDebug); diff --git a/StrafeOverdead/core/src/com/strafergame/ui/menus/TitleMenu.java b/StrafeOverdead/core/src/com/strafergame/ui/menus/TitleMenu.java index b8674ab..51b2036 100644 --- a/StrafeOverdead/core/src/com/strafergame/ui/menus/TitleMenu.java +++ b/StrafeOverdead/core/src/com/strafergame/ui/menus/TitleMenu.java @@ -1,10 +1,13 @@ package com.strafergame.ui.menus; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.utils.Align; +import com.kotcrab.vis.ui.widget.VisImage; import com.kotcrab.vis.ui.widget.VisTextButton; import com.strafergame.Strafer; import com.strafergame.screens.GameScreen; @@ -12,9 +15,13 @@ public class TitleMenu extends Table { Strafer game; + Group background = new Group(); + VisImage banner; public TitleMenu(Strafer game) { this.game = game; + makeBackground(); + setFillParent(true); pad(150); defaults().space(20); @@ -24,6 +31,14 @@ public TitleMenu(Strafer game) { makeButtons(); } + private void makeBackground() { + banner = new VisImage(Strafer.assetManager.get("ui/backgrounds/banner.png", Texture.class)); + background.addActor(banner); + banner.setAlign(Align.center); + Strafer.uiManager.addActor(background); + + } + private void makeButtons() { VisTextButton loadGameButton = new VisTextButton(Strafer.i18n.get("playButton")); loadGameButton.addListener(new ChangeListener() { @@ -59,6 +74,17 @@ public void changed(ChangeEvent event, Actor actor) { } + @Override + public void setVisible(boolean a) { + super.setVisible(a); + background.setVisible(a); + } + + public void resize() { + background.setBounds(0, 0, Strafer.uiManager.getWidth(), Strafer.uiManager.getHeight()); + banner.setScale(background.getHeight() / banner.getHeight()); + } + private void showLoadGameMenu() { if (Strafer.gameScreen == null) { Strafer.gameScreen = new GameScreen(game); diff --git a/StrafeOverdead/desktop/assets/ui/backgrounds/banner.png b/StrafeOverdead/desktop/assets/ui/backgrounds/banner.png index 6d0cb84..ad62e67 100644 Binary files a/StrafeOverdead/desktop/assets/ui/backgrounds/banner.png and b/StrafeOverdead/desktop/assets/ui/backgrounds/banner.png differ