Skip to content

Instantly share code, notes, and snippets.

@me2beats
Last active December 8, 2019 16:39
Show Gist options
  • Save me2beats/894703945ef82539896c55045a236d69 to your computer and use it in GitHub Desktop.
Save me2beats/894703945ef82539896c55045a236d69 to your computer and use it in GitHub Desktop.
Rounded triangle (one rounded corner)
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()
@me2beats
Copy link
Author

me2beats commented Dec 8, 2019

demo png:
https://imgur.com/a/p7UMwuA

not user friendly, just an example of how to use Stencil to make that shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment