Hi

Im looking for an effective way to manipulate batch members based on
group. For example,

batch = pyglet.graphics.Batch()
bg = pyglet.graphics.OrderedGroup(0)
fg = pyglet.graphics.OrderedGroup(1)

im = pyglet.image.load('im.png')
sp1 = pyglet.sprite.Sprite(im, batch=batch, group=bg)
sp2 = pyglet.sprite.Sprite(im, batch=batch, group=fg)

def on_mouse_press(...):
    del batch.group_children[fg]
    batch.top_groups.remove(fg)

#
In which the on_mouse_press event would remove the referenced sprite
from rendering. Ive done this to varying success/failure. The goal
here being, remove or destroy the sprite without actually having a
reference to it outside of the batch and group, mostly because i think/
feel it should be able to do this for me.

My actual use case involves a tree of sprites that extends from a
particular object that when using it could launch a modal like dialog.

Thanks for any advice,
Daniel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to