[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Re: fundamental (stupid) question about blitting part of a background image
Hi Brian,
thank you for the fast answer.
I will look up 'dirty rectangles' and medidate some time over your code.
From the first glance, it remind me a lot of the sprites methods.
What does the source, dest in the 'blit' function mean ?
Source and Dest are coordinates or Rectangles ?
bye,
/Horst
class DirtyRectScreen:
def __init__(self, screen):
self.rect_list = ()
self.screen = screen
def blit(self, source, dest):
self.rect_list.append(self.screen.blit(source, dest))
def erase(self, background_image):
for rect in self.rect_list:
self.screen.blit(background_image, (0,0), rect)
self.rect_list = ()
def update(self):
self.screen.update(self.rect_list)