from kivy.uix.button import Button
from kivy.core.window import Window
class HLButton(Button):
def __init__(self, *args, **kwargs):
super(HLButton, self).__init__(*args, **kwargs)
Window.bind(mouse_pos=self.pos_check)
def pos_check(self, inst, pos):
if self.collide_point(*pos):
self.background_color = (1, 0, 0, 1)
else:
self.background_color = (.52, .43, .57, 1)