summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-10 22:46:52 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-10 22:46:52 +0100
commitd916c350df43e4fee252809507d920ba4d71a647 (patch)
treef4d01e7ae02e389dfad7fe874e37870c75499d17 /core/src
parentcc31895064ce8f88577ce64a2a9af832879c01ed (diff)
downloadRustAndDust-d916c350df43e4fee252809507d920ba4d71a647.zip
RustAndDust-d916c350df43e4fee252809507d920ba4d71a647.tar.gz
center loading screen
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/screens/LoadScreen.java8
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();
}