pythonbuttonkivyborder-image

How to make the corners of my border image rounder in kivy


        self.kk = Button(text='pushme', size_hint=(0.15,0.15), background_color =[0,0,0,1])
        self.add_widget(self.kk)
        with self.kk.canvas.before:
            BorderImage(
            size=(self.kk.width + 20 , self.kk.height-7 ),
            pos=(self.kk.x  , self.kk.y),
            border=(50, 50, 50, 50),
            source='plain-white-background.jpg')

I want to make the border image rounder so i added 'border' as I though this would work i increased and decreased the number but no difference, if possible could give me the answer in python language


Solution

  • I don't think there's any straightforward way to round the corners of a BorderImage, except by rounding the corners of the image it is displaying. That should actually be quite easy, so it's the most obvious option.

    Within Kivy, you can use a RoundedRectangle canvas instruction, but then you can't use the normal button background properties (or must manually bind them to control the shape of that new instruction).