On Mon, Mar 14, 2005 at 02:16:35AM +0100, kabutor wrote:
> Any chance of adding to control.Button.background = soya.Material ?
> 
> Is just for making textured buttons. :)

probably the easiest way to accomplish this is override the render_self
method to use a texture

class MyButton(pudding.control.button):
        def render_self(self):
                myMaterial.activate()

                glBegin(GL_QUADS)
                glVertex3f( 0, 0, 0)
                glVertex3f( 0, height, 0)
                glVertex3f( width, height, 0)
                glVertex3f( width, 0, 0)
                glEnd()

If you just want an image that can respond to mouse events use:

class MyImage(pudding.control.Image, pudding.core.InputControl):
        def process_event(self, event):
                pudding.core.InputControl.process_event(self, event)

        def on_click(self):
                print "clicked"
                return True

have fun 
dunk


Reply via email to