On Oct 4, 8:56 pm, Alejandro Castellanos <[email protected]> wrote: > Hello. If I understand correctly your situation, you can easily do > that using ordered groups and it really isn't that complicated.
Unfortunately I don't think you understand my situation correctly :) But that's ok, I think a few others have the same problem, so my explanation is lacking. See this picture: http://lostgarden.com/uploaded_images/CuteGodMockup-723198.jpg This particular example is a bit misleading because it is built up of explicit layers. Instead of a simple background and foreground, there are 4 or 5 'background' layers and then characters and obstacles are drawn on top. But look at the ramp near the top of the middle of the picture. It obscures the view of the house behind it, even though both are on the same vertical level and would intuitively go on the same layer - ie. in the same ordered group. To get that to work the way I'd expect, I'd not just need to order objects vertically, but also from front to back. To do this, I would appear to require (height x depth) ordered groups, since pyglet.graphics.OrderedGroup doesn't appear to guarantee ordering within a group, only between groups. (The same seems to be implied at http://www.pyglet.org/doc/programming_guide/displaying_images.html#sprites.) This is pretty awkward to implement, especially when characters move around and change group. It's probably inefficient too (since I have to interleave rendering of terrain with characters instead of being able to do all of one and then all of the other). More efficient would be a z-buffer based approach, but I am open to alternatives. -- Ben Sizer --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
