[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Problem with display.update(rectangle_list)



Hi, I'm fairly new to pygame, and I tried posting this before, but I
don't think it went through (sorry if this is the fourth posting... I'm having a fail-day).

The issue I'm having is with pygame.display.update(
rectangle_list). It
doesn't seem to update correctly when I pass a rectangle list with
some surface.get_rect()'s (specifically, the surfaces are rendered
fonts), but it works just fine with a drawn rectangle list passed in
or when I leave out the argument entirely.

The weirdest thing to me is that even the surface rectangles will work
if I move the window outside of the screen (as in I drag the pygame
window outside of my monitor space) and then bring it back to the
visible desktop. However, if I only drag it out partially, only the
part that left the screen will come back in updated correctly.

Here's some code that is a simplified version of mine:

while True:
                   print 'running loop'
                   rects = []
                   w,h = pygame.display.get_surface().get_size()
                   font = pygame.font.Font(None,92)
                   white = (255, 255, 255)

                   surface = font.render("WORDS HERE!",0, white)
                   rects.append(surface.get_rect())

                   X = w/2
                   Y = h*.5


                   pygame.display.get_surface().blit(surface, (X,Y))
                   #print rects
                   pygame.display.update(rects)

                   pygame.time.delay(100)




I must be doing this wrong because I've searched everywhere and come
up with nothing. I'm using pygame 1.8 with Vista x64 and some of the
best hardware on the market (i7, 4850x2, etc). Help is very much
appreciated!!