globalforest/gpsblinker.py

16 lines
518 B
Python
Raw Normal View History

from kivy_garden.mapview import MapMarker
2020-10-14 12:41:26 -04:00
from kivy.animation import Animation
class GpsBlinker(MapMarker):
def blink(self):
2020-10-14 12:41:26 -04:00
# Animation that changes the blink size and opacity
anim = Animation(outer_opacity=0, blink_size=50)
# When the animation completes, reset the animation, then repeat
2020-10-14 12:41:26 -04:00
anim.bind(on_complete=self.reset)
anim.start(self)
def reset(self, *args):
self.outer_opacity = 1
self.blink_size = self.default_blink_size
self.blink()