+1 on adding an (optional) z coordinate to sprites, specifying z-index explicitly for 2D games is pretty important methinks. Aside from being able to leverage the depth buffer, you could also add functionality renders sprites in depth-order when composing with transparency.
Also on a side note, last time I checked sprites used integer vertex coordinates. That always seemed weird to me, as it doesn't allow leveraging sub-pixel rendering and makes movement along oblique angles inaccurate if you use the sprite coordinate as the authoritative position. Is there a good reason for them to be integers, or am I just smoking crack (again)? -Casey On Mon, Oct 5, 2009 at 6:01 AM, Tristam MacDonald <[email protected]> wrote: > > > On Mon, Oct 5, 2009 at 6:40 AM, Ben Sizer <[email protected]> wrote: >> >> 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. > > I agree with you fully on the depth buffer approach, which allows a single > group, with height * depth z-layers. > There was some discussion a while ago about adding a z-coordinate to all > Sprites, but I don't think it was ever resolved. > The easiest route would be to subclass pyglet.sprite.Sprite to add a > z-coodinate, and override the rendering methods as necessary to set it. > -- > Tristam MacDonald > http://swiftcoder.wordpress.com/ > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
