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 at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to