On 14.07.2011 22:51, sam.hacking@xxxxxxxx wrote:
Hi again Well, this s = pygame.Surface((400,300)) so = SurfaceObject(s)is just a matter how the contructor works. I would be similar to the internal class "Wrapper" of the SurfaceObject, which creates a new surface and blits the content on it. If you read the SurfaceObject's code carefully, you will see that I actually replace pygame.Surface with the Surface Object. This means anytime you call pygame.Surface(...) you'll get a SurfaceObject instead of a pygame.Surface. So you actually work with instances of SurfaceObject. And it works with all surface functions because it inherits from pygame.Surface. But maybe, this is the wrong approach for your "Problem", as others said, knowing more what you want can get you better solutions. At a second thought, what you describe is a "copy-constructor". Do you really need a copy constructor or could you just have a method that makes a copy of an existing SurfaceObject of yours? ~DR0ID |