Skip to content

Instantly share code, notes, and snippets.

@tshirtman
Created May 3, 2012 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tshirtman/2590109 to your computer and use it in GitHub Desktop.
Save tshirtman/2590109 to your computer and use it in GitHub Desktop.
#!/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