From e4f980b40dae860778a3fd7bd99ebbd44aec5580 Mon Sep 17 00:00:00 2001 From: 206530212 <2122823223@qq.com> Date: Tue, 22 Jun 2021 08:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'button.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- button.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/button.py b/button.py index 85b1a6b..34e9c2a 100644 --- a/button.py +++ b/button.py @@ -3,4 +3,10 @@ import pygame.font class Button(): - def __init__(self, ai_settings, screen, msg): \ No newline at end of file + def __init__(self, ai_settings, screen, msg): + """初始化按钮的属性""" + self.screen = screen + self.screen_rect = screen.get_rect() + + # 设置按钮的尺寸和其他属性 + self.width, self.height = 200, 50