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

Re: [pygame] RenderUpdate changes in pygame 1.7?



On Sun, 2005-10-09 at 10:20 +1000, Luke Miller wrote:
> Yes, I am subclassing RenderUpdates, but I thought that might muddy
> the waters of my previous email. I'll look into it. My own class is a
> form of OrderedRenderDirtyUpdates, that draws the sprites in order of
> their y-value on the screen.
> 
> To do that I have overrides for the following methods (based on a
> tutorial I think):

If anyone has the time to update the tutorial please do; I'll put it on
the site. I don't have time to do it myself at the moment.

> sprites
> add

You no longer need to override Sprite#add, just #add_internal.
Overriding #add is probably what's breaking it.

> add_internal
> remove_internal
> draw

There were some minor "ABI" kind of changes in RenderUpdates in 1.7,
though the API remains the same. The error message you cite is probably
happening because group.sprites() is returning a non-sequence.

> If you know of a new 1.7 way to draw sprites based on y-value I would
> love to hear it, but my 1.6 method worked quite well.

There's now an OrderedUpdates class which does FIFO order in drawing
(it's basically the one developed in my tutorial), if that's good
enough.
-- 
Joe Wreschnig <piman@xxxxxxxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part