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

Re: [pygame] Pygame Parachute, Dead Surface, Surface.subsurface(...), and Copying Surfaces



On 12/08/11 11:27 AM, Ian Mallett wrote:
Hi,

My solution is:

if isinstance(data,pygame.Surface):
    self.data = data.copy()
 else:
    self.data = copy.deepcopy(data)

Or you could try

if hasattr(data.__deepcopy__):
    self.data = copy.deepcopy(data)
else:
    self.date = copy.copy(data)

Lenard