title: How to use BitmapFont.TextBounds to center a line of text on the screen?
body: <p>The code I'm using to center these two lines of text are not working. <a href="http://tinypic.com/r/35ldu1j/8" rel="nofollow">Here</a> is the link of what it looks like on my screen, <a href="http://tinypic.com/r/35ldu1j/8" rel="nofollow">LINK</a></p>
  
  <p>Here is the code I used to do that, and I want both of the texts to be centered horizontally on the screen.</p>
  
  <pre><code>    BitmapFont.TextBounds titleBounds1 = font.getBounds("Pizza Delivery");
      BitmapFont.TextBounds titleBounds2 = font.getBounds("MADNESS");
  
      font.draw(batch,"Pizza Delivery", (Gdx.graphics.getWidth() - titleBounds1.width)  / 2,500);
      font.draw(batch,"MADNESS",(Gdx.graphics.getWidth() - titleBounds2.width)  / 2, 450);
  </code></pre>