def on_draw(self): with gx_matrix: glMultMatrixf(self.transform_gl) self.draw() self.controls.dispatch_event('on_draw') # use stencil for container with gx_stencil: drawRectangle((0, 0), size=self.size) stencilUse() self.container.dispatch_event('on_draw')
def stencil_push(self): stencilPush() # draw on stencil drawRectangle(pos=self.pos, size=self.size) # switch drawing to color buffer. stencilUse()