title: LibGDX - how do I make my text centered?
body: <p>I'm new to LibGDX and I am taking it slowly. I'm still trying to understand most things which is why typically google searches don't help due to the fact that their too complicated. I have a main menu that has text that I want centered no matter what the screen size is. Here is the code that I have for that menu.</p>
  
  <pre><code>public class Menu implements Screen {
  
  SlingshotSteve game;
  
  OrthographicCamera camera;
  
  public Menu(final SlingshotSteve gam) {
      this.game = gam;
  
      camera = new OrthographicCamera();
      camera.setToOrtho(false, 800, 480);
  }
  
  @Override
  public void render(float delta) {
  
      Gdx.gl.glClearColor(0, 0, 0.2f, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  
      camera.update();
      game.batch.setProjectionMatrix(camera.combined);
  
      game.batch.begin();
      game.font.draw(game.batch, "Welcome to Slingshot Steve!!! ", 100, 150);
      game.font.draw(game.batch, "Tap anywhere to begin!", 100, 100);
      game.batch.end();
  
      if (Gdx.input.isTouched()) {
          game.setScreen((Screen) new GameScreen(game));
          dispose();
      }
  }
  
  @Override
  public void resize(int width, int height) {
  
  }
  
  @Override
  public void show() {
  
  }
  
  @Override
  public void hide() {
  
  }
  
  @Override
  public void pause() {
  
  }
  
  @Override
  public void resume() {
  
  }
  
  @Override
  public void dispose() {
  
  }
  
  }
  </code></pre>