TransWikia.com

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

Stack Overflow Asked on January 3, 2022

        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

One Answer

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).

Answered by inclement on January 3, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP