title: How to create a pop-up in pygame with transparent background and how to control loop as a line is been drawn?
body: <pre><code>def timer_initial_state(screen):
      '''Creates an thin line representing the timer'''
      pygame.draw.line(screen,
                       COLOR_ORANGE_RED,
                       (0,screen.get_height()*0.35),
                       (screen.get_width(), screen.get_height()*0.35),
                       3)
  
  def timing_sequence(screen):
      '''Creates a timer in the form of a line'''
      increment = 0.01
      while increment &gt;=0:
          pygame.draw.line(
              screen,
              COLOR_BUTTON_UP,
              (screen.get_width()*increment, screen.get_height()*0.35),
              (0, screen.get_height()*0.35),
              3)
          pygame.draw.line(
              screen,
              COLOR_ORANGE_RED,
              (0, screen.get_height()*0.35),
              (screen.get_width(),screen.get_height()*0.35),
              3)
          increment += 0.01
  </code></pre>
  
  <p>The first function draws the line. The goal of the second is to draw over the first line in at a specific interval like that of a clock. ie. it should draw over a portion of the line after 1 second. </p>
  
  <p>What I want to do looks just like this:</p>
  
  <p><a href="https://i.stack.imgur.com/LXKCl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LXKCl.jpg" alt="screenshot"></a></p>
  
  <p>Furthermore, I want to show a popup after the timer is done with a transparent background.</p>