Is there an attribute called rect.center in pygame?
<p>I was looking through a pygame tutorial and encountered the following part of a script: </p>

<pre><code>fontObj = pygame.font.Font('freesansbold.ttf', 32)
textSurfaceObj = fontObj.render('hellow world', True, Green, Blue)
textRectObj = textSurfaceObj.get_rect()
textRectObj.center = (200,150)
</code></pre>

<p>The last line set the center of the rect at (200.150)
I looked through the pygame documentation and there is no center attribute in the Rect class.
But the script works... why ?</p>

<p>According to the <a href="http://www.pygame.org/docs/ref/rect.html" rel="nofollow">docs on rect</a>:</p>

<blockquote>
  <p>The Rect object has several virtual attributes which can be used to move and align the Rect:</p>
  
  <p>x,y</p>
  
  <p>top, left, bottom, right</p>
  
  <p>topleft, bottomleft, topright, bottomright</p>
  
  <p>midtop, midleft, midbottom, midright</p>
  
  <p><strong>center</strong>, centerx, centery</p>
  
  <p>size, width, height</p>
  
  <p>w,h</p>
</blockquote>

<p>I've bolded <code>center</code>.</p>

python pygame