ok, I will try to describe what i need. I have many sprites. let say, 50. they belong to different objects, different batch. for example, 5 groups of 10 sprites (a group is not a pyglet.graphics.OrderedGroup(), it's just a set of sprites).
for each group, I would like to apply a Mask. for me, a mask defines a rectangular region where the sprites will be visible. outside of that region, they will not be visible. If a sprite is half inside, half outside, it will be partially visible. to illustrate, please have a look here http://www.entheosweb.com/Flash/masking.asp in this case, there is only one sprite (the photo), and a dynamic mask (a moving circle). my need is similar (but more moving sprites, and rectangular masks). I hope this get clear little bit. Philippe On Feb 23, 6:20 pm, Casey Duncan <[email protected]> wrote: > What exactly are you trying to do? I'm skeptical that scissoring each > sprite independently is really what you want, not that it isn't > possible. Perhaps if we understood what you are doing better in the > abstract we could formulate a good solution. > > -Casey > > On Tue, Feb 23, 2010 at 9:59 AM, Philippe <[email protected]> wrote: > > Hi, > > > I searched a lot how to do something with your recommandations: > > """As long as you render each group separately, yes. > > > In pyglet, the best way to implement this would probably be a > > 'ScissorGroup' > > (much like OrderedGoup), which handles setting and unsetting the > > scissor > > rectangle. if I recall correctly, there might already be a > > ScissorGroup > > hidden away somewhere in the text rendering implementation... """ > > > but could not find. > > I'm afraid I do not look in the right direction. > > first, I am not sure to understand "As long as you render each group > > separately, yes." > > My group of sprites are in different batch. is it what you mean ? > > > I know how to use Scissor to apply a mask on my total application > > pyglet.gl.glScissor(offset_x, offset_y, 800, 480) > > pyglet.gl.glEnable(pyglet.gl.GL_SCISSOR_TEST) > > > But I do not see how to apply it to a single Sprite. > > Can you give me a advice on that ? > > > thank you > > > On Feb 16, 5:21 pm, Tristam MacDonald <[email protected]> wrote: > >> On Tue, Feb 16, 2010 at 10:36 AM, Philippe <[email protected]> > >> wrote: > >> > it's possible to apply different scissor_test to different group of > >> > sprites ? > > >> As long as you render each group separately, yes. > > >> In pyglet, the best way to implement this would probably be a > >> 'ScissorGroup' > >> (much like OrderedGoup), which handles setting and unsetting the scissor > >> rectangle. if I recall correctly, there might already be a ScissorGroup > >> hidden away somewhere in the text rendering implementation... > > >> -- > >> Tristam MacDonaldhttp://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 > > athttp://groups.google.com/group/pyglet-users?hl=en. -- 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.
