def __init__(self, colour, pos, text, handler=None, rectSize=None):
if rectSize == None:
image = pygame.image.load("assets/button.png").convert()
size = (image.get_rect().width, image.get_rect().height)
else:
size = rectSize
image = pygame.Surface(rectSize).convert()
image.fill(colour)
self.colour = colour
self.image = image
font = Font("assets/swiss911.ttf", 19)
textImage = font.render(text, False, colours.BLACK)
image.blit(textImage,
(image.get_rect().width - textImage.get_rect().width - 10,
image.get_rect().height - textImage.get_rect().height - 5))
LcarsWidget.__init__(self, colour, pos, size, handler)
self.applyColour(colour)
self.highlighted = False
self.beep = Sound("assets/audio/panel/202.wav")
评论列表
文章目录