Just ignore thread now.  Previously I stated that I figured out  that I needed 
to blit the background and update it before the while loop.  I have also, since 
learned how to use the Sprite and SpriteGroup classes, so I am using them now.


  ----- Original Message ----- 
  From: Gabriel Hasbun 
  To: [email protected] 
  Sent: Saturday, May 24, 2008 1:54 PM
  Subject: Re: [pygame] Dirty Rect updating



        I think you are not correctly blitting the background to the screen 
Surface. Although I can't be sure about it since you did not post any real 
python code...


        --- On Sat, 5/17/08, etrek <[EMAIL PROTECTED]> wrote:

          From: etrek <[EMAIL PROTECTED]>
          Subject: [pygame] Dirty Rect updating
          To: [email protected]
          Date: Saturday, May 17, 2008, 7:01 PM


          Hi,
          I'm trying to update just the portions of my screen that change per 
frame.  The problem I'm having is that only the image I'm animating is showing 
up.  My background is not showing up -  background is now black.  

          I'm not using Sprite/SpriteGroup, but I will soon, and I'm thinking 
I'll have the same problem when I try to render the dirty rects list returned 
by RnderUpdates.draw() method.


          pseudocode:

          background = pygame.image.load(background.png)
          surface = pygame.image.load(spaceship)
          while true:
              get events
              clear screen to white
              blit background
              blit spaceship  
              create rect of where surface is on screen
              pygame.display.update(rect)   # which in this case is a rectangle 
in the location of my animated surface



          I'm following procedure from 
http://www.pygame.org/docs/tut/newbieguide.html:
            1.. Blit a piece of the background over the sprite's current 
location, erasing it. 
            2.. Append the sprite's current location rectangle to a list called 
dirty_rects. 
            3.. Move the sprite. 
            4.. Draw the sprite at it's new location. 
            5.. Append the sprite's new location to my dirty_rects list. 
            6.. Call display.update(dirty_rects)
          Thanks for help
          Ethan

       

Reply via email to