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

Re: [pygame] duplicate images



Generally you don't need to duplicate images (really) unless you are modifying them separately - just use different commands for blitting...

ie

image = SomePygameImage
screen.blit(image, (0,0))
screen.blit(image, (100,100))

Will draw the image in two completely different places...

On Thu, Oct 8, 2009 at 1:56 PM, Thiago Petruccelli <thiagopetruccelli@xxxxxxxxx> wrote:
Hi!

I am using windows(ugh) in the interface of my game, and then I made a close button. My game structure load all images in the startup of the game; but when I try to copy then, things don't work as I wanted... when I close a window and open another (wich is supposed to have a copy of the close button with his own properties), it happens that the close button appears in the old place, not in the right place in the opened window. I tried to use de copy command from the copy module, but it didn't work. It seems that python thinks it's the same object; I want to make a duplicate of it.

I saw an example of a game using various enemies(the same image), but the author load an image for every new enemy on the screen (using pygame.image.load)

Someone knows how to do this duplicate?
--
Thiago Henrique Petruccelli