Created
May 3, 2012 22:44
-
-
Save tshirtman/2590109 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 | |
from kivy.animation import Animation | |
Builder.load_string(''' | |
<ArrowPointer>: | |
canvas: | |
Color: | |
rgb: 0, 0, 111 / 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) | |
def on_touch_down(self, touch, *args): | |
Animation(x=(self.x+100)%500).start(self) | |
return True | |
class TestB(App): | |
def build(self): | |
return ArrowPointer() | |
if __name__ == '__main__': | |
TestB().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment