Re: [pygame] Re: Extending Surface Class

2009-07-26 Thread Jake b
I got here too late for the self answer, but I wanted to add: In case you
haven't heard of pygame Sprite()'s
Depending on what you're' doing, it might be more usefulll to derive
pygame.sprite.Sprite() [ which is a Surface, and Rect ] But also allows you
to use sprite groups. ]
You can think of them to be similar to shared pointers, in that if the
sprite is in any group, it stays alive, since there is a reference to it.

http://www.pygame.org/docs/tut/SpriteIntro.html
http://www.sacredchao.net/~piman/writing/sprite-tutorial.shtml
-- 
Jake


Re: [pygame] Re: Extending Surface Class

2009-07-25 Thread Tyler Laing
By wrapper, he means writing a python class that has an internal member,
_sruf, which is the surface in question. Then you can override the __str__
function with your own. Otherwise, you just call _sruf's own methods and
attrs

-Tyler

On Sat, Jul 25, 2009 at 2:48 PM, ERName wrote:

> Well, I appreciate your reply, but I don't really understand what you
> mean by "wrapper"... and this mysterious _sruf attribute?
>
> The part about being a C object I understand, though, and I was afraid
> of that. If there's not any easy way of doing this, I can just live
> with the default __str__(), I guess.
>



-- 
Visit my blog at http://oddco.ca/zeroth/zblog