更新 'button.py'

This commit is contained in:
206530212 2021-06-23 16:17:48 +08:00
parent b61138d9e7
commit 00a9921265
1 changed files with 4 additions and 0 deletions

View File

@ -15,4 +15,8 @@ class Button():
self.font = pygame.font.SysFont('arial', 48)
# 创建按钮的rect对象并使其居中
self.rect = pygame.Rect(0, 0, self.width, self.height)
self.rect.center = self.screen_rect.center
# 按钮的标签只需创建一次
self.prep_msg(msg)