Re: [pygame] Surface objects

2011-07-15 Thread Michael Carius
On Fri, Jul 15, 2011 at 5:41 AM, DR0ID wrote: > ** > On 15.07.2011 13:52, sam.hack...@sent.com wrote: > > On Thu, 14 Jul 2011 13:57 -0700, "Michael Carius" > wrote: > > # Python 2.x code > class MySurface(object): > def __init__(self, obj): > if isinstance(obj, tuple): >

Re: [pygame] Surface objects

2011-07-15 Thread DR0ID
On 15.07.2011 13:52, sam.hack...@sent.com wrote: On Thu, 14 Jul 2011 13:57 -0700, "Michael Carius" wrote: # Python 2.x code class MySurface(object): def __init__(self, obj): if isinstance(obj, tuple): self._surf = pygame.Surface(*tuple) elif isinstance(obj, pygam

Re: [pygame] Surface objects

2011-07-15 Thread sam . hacking
On Thu, 14 Jul 2011 13:57 -0700, "Michael Carius" wrote: # Python 2.x code class MySurface(object): def __init__(self, obj): if isinstance(obj, tuple): self._surf = pygame.Surface(*tuple) elif isinstance(obj, pygame.Surface): self._surf =

Re: Re: [pygame] Surface objects

2011-07-15 Thread info
game-users@seul.org Sent: Thu, Jul 14, 2011, 10:08 PM Subject: Re: [pygame] Surface objects On 14.07.2011 22:51, sam.hack...@sent.com wrote: On Thu, 14 Jul 2011 19:05 +0200, "DR0ID" wrote: An old experiment of mine, it might give you a clue how you can do it (actually it replace

Re: [pygame] Surface objects

2011-07-14 Thread DR0ID
On 14.07.2011 22:51, sam.hack...@sent.com wrote: On Thu, 14 Jul 2011 19:05 +0200, "DR0ID" wrote: An old experiment of mine, it might give you a clue how you can do it (actually it replaces the pygame Surface object with the SurfaceObject class): https://python-pyknic.googlecode.com/svn/branc

Re: [pygame] Surface objects

2011-07-14 Thread Greg Ewing
sam.hack...@sent.com wrote: What I want to know is, how can you get it to act like that if you already have a surface. I don't think it's possible to do this in such a way that the resulting object will work as a Surface in all contexts. One way I've just thought of, maybe if I create a new

Re: [pygame] Surface objects

2011-07-14 Thread inigo.delg...@gmail.com
I dont understand well what are you wanting to do, a wrapper? Do a class that inherits Surface and that contains a Surface. Do implement all the methods callables of the object and say them to do in inside's surface, a simple example will be: class A: def __init__(self): print "init

Re: [pygame] Surface objects

2011-07-14 Thread Michael Carius
On Thu, Jul 14, 2011 at 10:05 AM, DR0ID wrote: > ** > On 14.07.2011 16:18, sam.hack...@sent.com wrote: > > Hey guys, > > I have a class which inherits from pygame.Surface. If the class gets > created with a tuple, I create a new surface by calling > pygame.Surface.__init__, so my class will wor

Re: [pygame] Surface objects

2011-07-14 Thread sam . hacking
On Thu, 14 Jul 2011 19:05 +0200, "DR0ID" wrote: An old experiment of mine, it might give you a clue how you can do it (actually it replaces the pygame Surface object with the SurfaceObject class): [1]https://python-pyknic.googlecode.com/svn/branches/pyknic-2.0/e xperimental/surfaceobject.py Rig

Re: [pygame] Surface objects

2011-07-14 Thread DR0ID
On 14.07.2011 16:18, sam.hack...@sent.com wrote: Hey guys, I have a class which inherits from pygame.Surface. If the class gets created with a tuple, I create a new surface by calling pygame.Surface.__init__, so my class will work as a pygame.Surface object. I also need this class to be cr

[pygame] Surface objects

2011-07-14 Thread sam . hacking
Hey guys, I have a class which inherits from pygame.Surface. If the class gets created with a tuple, I create a new surface by calling pygame.Surface.__init__, so my class will work as a pygame.Surface object. I also need this class to be created with existing pygame.Surface objects. So, if I