title: How to Center Text in Pygame
body: <p>I have some code:</p>
  <pre><code># draw text
  font = pygame.font.Font(None, 25)
  text = font.render(&quot;You win!&quot;, True, BLACK)
  screen.blit(text, [SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2])
  </code></pre>
  <p>How can I get the text's width and height, so I can center text like this:</p>
  <pre><code>screen.blit(text, [SCREEN_WIDTH / 2 - text_w / 2, SCREEN_HEIGHT / 2 - text_h / 2])
  </code></pre>
  <p>If this is not possible, what is another way ?
  I've found <a href="http://www.pygame.org/docs/tut/tom/games2.html" rel="noreferrer">this</a> example, but I didn't really understand it.</p>