更新 'button.py'

This commit is contained in:
206530219 2021-06-17 18:31:43 +08:00
parent 8ece8ca645
commit 9747956d48
1 changed files with 32 additions and 29 deletions

View File

@ -7,13 +7,16 @@ class play_Button:
self.screen = screen
self.screen_rect = screen.get_rect()
# 设置按钮的尺寸和其他属性
self.width, self.height = 200, 50 # 按钮的尺寸
self.button_color = (0, 0, 0) # 按钮颜色
self.text_color = (255, 255, 255) # 按钮中文本的颜色
self.font = pygame.font.SysFont(None, 48)
# 创建按钮的rect对象
self.rect = pygame.Rect(540, 300, self.width, self.height)
# self.rect.center = self.screen_rect.center
# 按钮的标签只需创建一次
self.prep_msg(msg)