diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/LoadScreen.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/screens/LoadScreen.java b/core/src/ch/asynk/tankontank/screens/LoadScreen.java index d55e12d..8aea946 100644 --- a/core/src/ch/asynk/tankontank/screens/LoadScreen.java +++ b/core/src/ch/asynk/tankontank/screens/LoadScreen.java @@ -26,6 +26,8 @@ public class LoadScreen implements Screen private boolean assetsLoaded; private Texture bg; private Texture unit; + private float dx; + private float dy; private final Camera camera; private final SpriteBatch batch; @@ -42,6 +44,8 @@ public class LoadScreen implements Screen this.viewport = new FitViewport(width, height, camera); this.ready = false; this.assetsLoaded = false; + this.dx = ((width - 800) / 2f); + this.dy = ((height - 600) / 4f); } @Override @@ -67,8 +71,8 @@ public class LoadScreen implements Screen Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setProjectionMatrix(camera.combined); batch.begin(); - batch.draw(bg, 0, 0); - batch.draw(unit, x, y); + batch.draw(bg, dx, dy); + batch.draw(unit, (x + dx), (y + dy)); batch.end(); } |