Last active
December 8, 2019 16:39
-
-
Save me2beats/894703945ef82539896c55045a236d69 to your computer and use it in GitHub Desktop.
Rounded triangle (one rounded corner)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
KV = """ | |
Widget | |
size_hint: None, None | |
size: 200,200 | |
radius: [0,0,0,30] | |
pos: 100,100 | |
canvas: | |
StencilPush | |
Color: | |
rgba: 0.4,0.3,0.5,1 | |
RoundedRectangle | |
size: self.size | |
pos: self.pos | |
radius: self.radius | |
Triangle | |
points: (self.x, self.top, self.right, self.top, self.right, self.y) | |
StencilUse | |
RoundedRectangle | |
size: self.size | |
pos: self.pos | |
radius: self.radius | |
StencilPop | |
""" | |
class MyApp(App): | |
def build(self): | |
return Builder.load_string(KV) | |
MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
demo png:
https://imgur.com/a/p7UMwuA
not user friendly, just an example of how to use Stencil to make that shape