title: How to draw text in front of the background?
body: <p>I am making a program in pygame. The program first typewrites some text according to a event in the event loop. The problem with this is that the text will be behind the background.</p>
  <p>The section that typewrites stuff:</p>
  <pre class="lang-py prettyprint-override"><code>        elif event.type == write_text_0_event:
              if index_0 &lt;= len(msg0) - 1:
                  current_text_0 += msg0[index_0]
  
                  text = font.render(current_text_0, True, (255, 255, 255))
                  screen.blit(text, (100, 100))
  
                  index_0 += 1
  </code></pre>
  <p>The part that draws the background:</p>
  <pre class="lang-py prettyprint-override"><code>while running:
      # [...] (the event loop)
      screen.blit(city_bg, (0, 0))
  </code></pre>
  <p>I have tried butting the <code>screen.blit()</code> line in front of the event loop but still, the text is behind the background.</p>
  <p>How can I make the text appear in front of the background instead of it appearing behind the background?</p>