You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SafariChess/SafariChess_Classes.py

23 lines
504 B

3 years ago
"""
SafariChess_Classes.py
Classes for button and keyboard events
"""
class Button:
def _init_(self, image, position, callback=None):
self.image = image
self.rect = image.get_rect(topleft=position)
self.callback = callback
def on_click(self, mouse_pos):
if self.rect.collidepoint(mouse_pos):
if self.callback:
self.callback()
return True
return False
#class DropDown():
#下拉选择框