It works well.
I will probably write a Sprite class that implement a mask if needed.
thank you!

On Feb 9, 12:12 am, Richard Jones <[email protected]> wrote:
> Without resorting to shaders or very complex scene composition that's
> the only way to do it.
>
>      Richard
>
> On 9 February 2012 03:16, Philippe <[email protected]> wrote:
>
>
>
>
>
>
>
> > Is this the best way to do it ?
>
> > class MySprite(Sprite):
>
> >    def __init__(self):
> >        super(MySprite, self ).__init__('my_sprite.png')
> >        self.gap = 100
>
> >    def draw(self):
> >        pyglet.gl.glScissor(self.x-self.width/2, self.y-self.height/2,
> > self.width - self.gap, self.height)
> >        pyglet.gl.glEnable(pyglet.gl.GL_SCISSOR_TEST)
> >        super(MySprite, self ).draw()
> >        pyglet.gl.glDisable(pyglet.gl.GL_SCISSOR_TEST)
>
> > On 7 fév, 10:04, Philippe <[email protected]> wrote:
> >> Hello,
>
> >> Is there a way to clip a cocos2d Sprite ? (or mask, same thing, but
> >> different word).
>
> >> thank you,
> >> Philippe
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "cocos2d discuss" 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/cocos-discuss?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" 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/cocos-discuss?hl=en.

Reply via email to