[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Surface problem



Hi, I got a problem, but I don't know if I can explain it rightly because of my cursed english...but I'll try...

I got a function that load a surface from an Image. I call It

self.surface = load_surface('image.jpg')

adn after I copy self.surface in a new var:

self.base = self.surface.

I got a Metod called setText: this method simply takes 1 arg ad, if it's not null, it assign this arg to the var self.text, and replace self.surface whit a new one:

this is the method:

    def setText(self,text):
        if text != None:
            self.text = text
            self.surface = self.base
            self.surface.blit(self.font.getSurface(self.text),(3,1))

(getSurface render the text in a surface)

If i'lltry it, it works well, but if i'll try i many times, every times the surface I see is the right surface, but whit the text painted many times, as self.base would be modified by the blit function...

I don't know if U understand it but I hope...

bye

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org