From 4bbc5975a7365166ea803eb5c00f9e21f6c4f105 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 4 Apr 2024 20:56:17 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=95=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common_const.py | 7 +++++++ main.py | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 common_const.py diff --git a/common_const.py b/common_const.py new file mode 100644 index 0000000..f940ab5 --- /dev/null +++ b/common_const.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class CWindow (BaseModel, frozen = True): + WIDTH: int = 1024 + HEIGHT: int = 768 + diff --git a/main.py b/main.py index 2833e38..6396ea3 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,7 @@ from playsound import playsound from pygame.locals import * from aques import Aques +from common_const import * from common_module import CommonModule from talk import Talk from youtube import * @@ -24,11 +25,12 @@ class Main: # ウィンドゥの初期化 pygame.init () - screen: pygame.Surface = pygame.display.set_mode ((1024, 768)) + screen: pygame.Surface = pygame.display.set_mode ( + (CWindow.WIDTH, CWindow.HEIGHT)) # 吹き出し balloon = pygame.transform.scale (pygame.image.load ('talking.png'), - (1024, 384)) + (CWindow.WIDTH, 384)) if goatoh_mode: balloon = pygame.transform.flip (balloon, False, True)