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

Re: [pygame] newbie question--> rendeing order



Hi Enrike.

A lot of people who are new to Pygame seem to be trepedatious to use
multiple groups.  This would be a solution to your problem.  You could
have two groups that get rendered, a "main" group and a "selected"
group.  Just draw the sprites in the "selected" group at the end, and
they will appear on top.

On Tue, 2003-07-08 at 08:19, enrike@ixi-software.net wrote:
> hi all,
> 
> i am new to pygame and phyton. i have a question that could be 
> stupid for somebody with more experience. i have tried to read 
> documentation and search for solutions on the net ut no luck. So 
> there is goes:
> I was wondering if there is some way to change the rendering order 
> of a group of sprites "on the fly". I want to bring the clicked sprite 
> above the others.
> So far i have manage to do it by storing a reference of the sporites 
> in a list, change the order of that list, remove all objects from the 
> rendering group and adding the whole list back again to the group.
> 
> I was looking for some way to access the sprites in the group and 
> change the order directly. Pop the sprite that goes to the top and 
> append it to the group again or sthg similar
> 
> btw. my goal is to create in pygame interfaces that communicate to 
> Pure Data (visual sound programming environment). and i was 
> wondering which methods i could use to achive bidirectional 
> comumnication from Phyton to PD. Any suggestions are welcome.
> 
> many thanks in advance
-- 
+-------------------------------------------------------------+
| Shandy Brown                               Digital Thinkery |
| shandy@geeky.net             http://www.digitalthinkery.com |
+-------------------------------------------------------------+