更新 'button.py'
This commit is contained in:
parent
8ece8ca645
commit
9747956d48
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue