Created
May 5, 2012 16:41
-
-
Save tshirtman/2603892 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
from kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.properties import ObjectProperty, NumericProperty | |
from kivy.lang import Builder | |
Builder.load_string(''' | |
<ArrowPointer>: | |
canvas: | |
Color: | |
rgb: 0, 0, 255 / 255. | |
Line: | |
points: self.x - self.offset, self.y - self.offset, self.x + self.offset, self.y + self.offset | |
''') | |
class ArrowPointer(Widget): | |
arrow_tip = ObjectProperty(None) | |
offset = NumericProperty(50) | |
class TestWidget(Widget): | |
arrow = ObjectProperty(None) | |
def __init__(self, **kwargs): | |
super(TestWidget, self).__init__(**kwargs) | |
self.arrow = ArrowPointer() | |
self.add_widget(self.arrow) | |
class TestB(App): | |
def build(self): | |
return TestWidget() | |
if __name__ == '__main__': | |
TestB().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment