Hi guys,

This is something that comes up pretty often. Users looking for a z value 
on the sprites, allowing easy depth sorting without needing to use the 
OrderedGroups. 
At first this seems easy to add to the existing sprite class, but 
unfortunately translucent sprites (sprite.opacity) do not blend together 
correctly if you simply add the additional z vertex. This page on the 
OpenGL wiki explains the issue in some detail: 
https://www.opengl.org/wiki/Transparency_Sorting

I have a branch here, which has the bare minimum added to get z sorting 
working: https://bitbucket.org/treehousegames/pyglet/branch/z_sprite
Translucency (sprite.opacity), however, does not work correctly. Only pure 
transparency (100% invisible) works, which is enough for some cases but not 
all. The only change made outside of the Sprite module is to the 
Window.on_resize method, which changes the z range from (-1, 1) to (-255, 
255). This is so that if you're NOT using subpixel sprites, then you can 
use whole numbers for the z value and not have them clamped to ints.

Ideally, it would be nice if the current sprite API and operation could be 
kept, but I'd love to hear you guys thoughts on this. 

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to