diff --git a/assets/images/background_main.png b/assets/images/background_main.png index aa69e2b..09a71b5 100644 Binary files a/assets/images/background_main.png and b/assets/images/background_main.png differ diff --git a/assets/images/background_main_edited.png b/assets/images/background_main_edited.png deleted file mode 100644 index 6b588a3..0000000 Binary files a/assets/images/background_main_edited.png and /dev/null differ diff --git a/assets/images/background_menu.png b/assets/images/background_menu.png new file mode 100644 index 0000000..8afee52 Binary files /dev/null and b/assets/images/background_menu.png differ diff --git a/assets/images/ground_temp_tmp.png b/assets/images/ground_temp_tmp.png deleted file mode 100644 index a526e8b..0000000 Binary files a/assets/images/ground_temp_tmp.png and /dev/null differ diff --git a/components/config.py b/components/config.py index 2188f2f..b8cc2ad 100644 --- a/components/config.py +++ b/components/config.py @@ -5,11 +5,11 @@ import pygame.constants class CONST: - SCREEN_SIZE = [640, 360] - """화면 (카메라) 크기 (640x360)""" + SCREEN_SIZE = [960, 540] + """화면 (카메라) 크기 (960x540)""" - SURFACE_SIZE = [1280, 720] - """세계 크기 (1280x720)""" + SURFACE_SIZE = [1920, 1080] + """세계 크기 (1920x1080)""" COL_WHITE = (255, 255, 255) COL_BLACK = (0, 0, 0) @@ -38,8 +38,18 @@ class Fonts(Enum): class CONFIG: FPS = 30 - window_size = [1280, 720] # CONST.WINDOW_SIZE * 2 - window_scale = 2 + window_size = [1440, 810] # CONST.SCREEN_SIZE * 1.5 + window_scale = 1.5 + + resolutions = [ + [480, 270], + [960, 540], + [1440, 810], + [1920, 1080], + [2560, 1440], + [3840, 2160] + ] + """적용할 수 있는 해상도 배열""" surface = pygame.Surface(CONST.SURFACE_SIZE) """크기가 [640, 360]으로 고정된 화면 @@ -118,7 +128,7 @@ def get_mouse_pos() -> tuple[int, int]: mouse_pos[0] // CONFIG.window_scale, mouse_pos[1] // CONFIG.window_scale ) - + # 월드 좌표 구현에 따른 오프셋 적용 cameraed = ( upscaled[0] + CONFIG.camera_x, diff --git a/components/text/__init__.py b/components/text/__init__.py index 0f5ac94..7c62ac9 100644 --- a/components/text/__init__.py +++ b/components/text/__init__.py @@ -33,6 +33,15 @@ class Text: < : 줄바꿈 (New Line) """ + FONT = Fonts.TITLE2 + PT = 18 + + SYNTAX: dict[str, tuple[Font, int]] = { + "*": (Fonts.TITLE3, PT), + "#": (Fonts.TITLE2, PT + 4), + "/": (Fonts.DIALOG, PT - 4) + } + def __init__(self, text: str, delay: Optional[int] = 30): """ Text 클래스를 생성합니다. @@ -93,19 +102,14 @@ def write( ch_x = char_position[0] ch_y = char_position[1] - font = Fonts.DIALOG - pt = 15 + font = Text.FONT + pt = Text.PT px = 0 - match mutual.prefix: # 접두어별 맞는 폰트 지정 - case "*": - font = Fonts.TITLE3 - case "#": - font = Fonts.TITLE2 - pt += 2 - case "/": - font = Fonts.TITLE2 - pt -= 3 + if mutual.prefix in Text.SYNTAX: # 접두어별 맞는 폰트 지정 + syntax = Text.SYNTAX[mutual.prefix] + font = syntax[0] + pt = syntax[1] px = pt / 3.0 * 4.0 # pt를 픽셀로 변환 chs = mutual.text[index] # 문자 diff --git a/components/text/text_collection.py b/components/text/text_collection.py index 64d7c12..984f7e1 100644 --- a/components/text/text_collection.py +++ b/components/text/text_collection.py @@ -34,17 +34,15 @@ def __init__( self.textList = [] self.position = pos - pt = 15 # 폰트 단위 + pt = Text.PT # 폰트 단위 text_width = 0.0 # 현재 텍스트 너비 modified_text = "" # 줄바꿈이 들어간 텍스트 for text in texts: # Text for mutual in text.texts: # Mutual Text - match mutual.prefix: # 접두어 - case "#": - pt += 2 - case "/": - pt -= 3 + if mutual.prefix in Text.SYNTAX: # 접두어별 맞는 폰트 지정 + syntax = Text.SYNTAX[mutual.prefix] + pt = syntax[1] px = pt / 3.0 * 4.0 # pt를 픽셀로 변환 diff --git a/main.py b/main.py index 1f16f30..f840120 100644 --- a/main.py +++ b/main.py @@ -54,14 +54,14 @@ def main(): CONFIG.is_fullscreen = True if args.fullhd: # FHD (1920x1080) - CONFIG.window_size = (1920, 1080) - CONFIG.window_scale = 3 + CONFIG.window_size = [1920, 1080] + CONFIG.window_scale = 2 update_screen_resolution() # 화면 해상도 업데이트 elif args.quadhd: # QHD (2560x1440) - CONFIG.window_size = (2560, 1440) - CONFIG.window_scale = 4 + CONFIG.window_size = [2560, 1440] + CONFIG.window_scale = 2.6666 update_screen_resolution() # 화면 해상도 업데이트 diff --git a/maps/__init__.py b/maps/__init__.py index 189c6c0..0bf4a17 100644 --- a/maps/__init__.py +++ b/maps/__init__.py @@ -63,8 +63,7 @@ def render(self, frame_count: int): 맵을 렌더링합니다. :param frame_count: 1초 당 누적되는 프레임 렌더링하는 개수 (범위: 0~10) """ - self.background.set_pos(CONFIG.camera_x, self.background.y) - #self.background.set_pos(CONFIG.camera_x // 1.1, self.background.y) # 조금씩 움직이게 하고 싶어요 + self.background.set_pos(CONFIG.camera_x, self.background.y) CONFIG.surface.blit(self.background.image.convert(), self.background.get_pos()) CONFIG.surface.blit(self.floor.image, self.floor.get_pos()) diff --git a/maps/map_main.py b/maps/map_main.py index bc8bb94..02242db 100644 --- a/maps/map_main.py +++ b/maps/map_main.py @@ -23,7 +23,7 @@ def __init__(self, player: Player, sign): # NPC self.sign = sign - self.emilia = Player("assets/images/chr_emilia.png", (400, 210), 0.4) # 에밀리아 + self.emilia = Player("assets/images/chr_emilia.png", (400, 360), 0.4) # 에밀리아 self.emilia.dialog = TextCollection( [ Text("*안녕!*"), @@ -37,7 +37,7 @@ def __init__(self, player: Player, sign): self.NPCs = [self.emilia] # 적 - self.enemy = Enemy("assets/images/chr_raon.png", (1000, 237), 0.4) + self.enemy = Enemy("assets/images/chr_raon.png", (1000, 387), 0.4) self.enemies = [self.enemy] for enemy in self.enemies: @@ -53,7 +53,7 @@ def __init__(self, player: Player, sign): ) }, "default", - position=(800, 285), + position=(800, 435), scale=0.4)) self.spike2 = Player.get_from_sprite(SpriteCollection({ @@ -64,11 +64,11 @@ def __init__(self, player: Player, sign): ) }, "default", - position=(850, 285), + position=(850, 435), scale=0.4)) self.obstacles = [self.spike, self.spike2] # 배경 - self.background = Texture("assets/images/background_main_edited.png", (0, 0), 1, repeat_x=2, fit=True) - self.floor = Texture("assets/images/grass.png", (0, 320), 0.4, repeat_x=2) \ No newline at end of file + self.background = Texture("assets/images/background_main.png", (0, 0), 1, repeat_x=2, fit=True) + self.floor = Texture("assets/images/grass.png", (0, 470), 0.5, repeat_x=2) \ No newline at end of file diff --git a/maps/map_test.py b/maps/map_test.py new file mode 100644 index 0000000..caacb28 --- /dev/null +++ b/maps/map_test.py @@ -0,0 +1,44 @@ +from maps import Map + +from characters.player import Player +from characters.enemy import Enemy +from characters.texture import Texture + +from components.events.grace_period import GracePeriod +from components.events.text import TextEvent + +from components.text import Text +from components.text.text_collection import TextCollection + +from components.sprites.sprite import Sprite +from components.sprites.sprite_handler import SpriteHandler +from components.sprites.sprite_collection import SpriteCollection + +class MapTest(Map): + def __init__(self, player: Player, sign): + super(Map, self).__init__() + + self.player = player + + # # NPC + # self.sign = sign + + # self.emilia = Player("assets/images/chr_emilia.png", (400, 193), 0.4) # 에밀리아 + # self.emilia.dialog = TextCollection( + # [ + # Text("#이 쪽으로 잘 왔구나!#"), + # Text("여기는 훈련장이야."), + # Text("쭉 가면 적이 출몰할거야!"), + # Text("적은 *J키*로 공격할 수 있으니 참고하라구!") + # ], + # self.sign.width + # ) + + self.NPCs = [] + + self.obstacles = [] + self.enemies = [] + + # 배경 + self.background = Texture("assets/images/background_main.png", (0, 0), 1, repeat_x=2, fit=True) + self.floor = Texture("assets/images/ground.png", (0, 320), 0.4, repeat_x=2) \ No newline at end of file diff --git a/maps/map_training.py b/maps/map_training.py index 72c4a49..2805b66 100644 --- a/maps/map_training.py +++ b/maps/map_training.py @@ -23,7 +23,7 @@ def __init__(self, player: Player, sign): # NPC self.sign = sign - self.emilia = Player("assets/images/chr_emilia.png", (400, 193), 0.4) # 에밀리아 + self.emilia = Player("assets/images/chr_emilia.png", (400, 375), 0.4) # 에밀리아 self.emilia.dialog = TextCollection( [ Text("#이 쪽으로 잘 왔구나!#"), @@ -41,4 +41,4 @@ def __init__(self, player: Player, sign): # 배경 self.background = Texture("assets/images/background_training.png", (0, 0), 1, repeat_x=2, fit=True) - self.floor = Texture("assets/images/ground_temp.png", (0, 320), 0.4, repeat_x=2) \ No newline at end of file + self.floor = Texture("assets/images/ground_temp.png", (0, 482), 0.6, repeat_x=2) \ No newline at end of file diff --git a/screens/ingame.py b/screens/ingame.py index 9918e0b..081d233 100644 --- a/screens/ingame.py +++ b/screens/ingame.py @@ -23,6 +23,7 @@ from maps.map_main import MapMain from maps.map_training import MapTraining +from maps.map_test import MapTest from maps.map_manager import MapManager from screens.pause_menu import update_pause_menu @@ -55,7 +56,7 @@ def __init__(self): )) }, "stay", - position=(200, 197), + position=(200, 347), scale=0.4, ), True, @@ -75,7 +76,7 @@ def __init__(self): scale=0.6) # 기타 아이템 - self.sign = Texture("assets/images/sign_big.png", (300, 100), 0.3) + self.sign = Texture("assets/images/sign_big.png", (300, 100), 0.4) self.hp = SpriteCollection({ "attacked": SpriteHandler( Sprite( @@ -88,7 +89,7 @@ def __init__(self): }, "attacked", position=(0, 0), - scale=0.4 + scale=0.6 ) def update_ingame(self): @@ -184,7 +185,8 @@ def process_ingame(event: pygame.event.Event): MapManager.maps = { "main": MapMain(self.player, self.sign), - "training": MapTraining(self.player, self.sign) + "training": MapTraining(self.player, self.sign), + "test": MapTest(self.player, self.sign) } MapManager.apply("main") @@ -274,7 +276,7 @@ def process_ingame(event: pygame.event.Event): self.dead_background = pygame.transform.scale( self.dead_background, ( - self.dead_background.get_width() + 20, + self.dead_background.get_width() + 60, self.dead_background.get_height() - 20, ), ) @@ -294,7 +296,7 @@ def process_ingame(event: pygame.event.Event): self.button_retry = Button( image=button_retry_image, - pos=(320, 220), + pos=(480, 225), text_input="재도전", font=Font(Fonts.TITLE2, 30).to_pygame(), base_color="#ffffff", @@ -311,16 +313,16 @@ def process_ingame(event: pygame.event.Event): self.button_menu = Button( image=button_menu_image, - pos=(320, 280), + pos=(480, 280), text_input="메뉴 화면으로", font=Font(Fonts.TITLE2, 30).to_pygame(), base_color="#ffffff", hovering_color="White", ) - CONFIG.surface.blit(self.dead_background, (180 + CONFIG.camera_x, 120 + CONFIG.camera_y)) + CONFIG.surface.blit(self.dead_background, (320 + CONFIG.camera_x, 120 + CONFIG.camera_y)) CONFIG.surface.blit( - self.dead_text, self.dead_text.get_rect(center=(320 + CONFIG.camera_x, 160 + CONFIG.camera_y)) + self.dead_text, self.dead_text.get_rect(center=(483 + CONFIG.camera_x, 160 + CONFIG.camera_y)) ) for button in [self.button_retry, self.button_menu]: @@ -336,9 +338,9 @@ def process_ingame(event: pygame.event.Event): # region FPS 표시 if CONFIG.game_fps: fps = round(CONFIG.clock.get_fps(), 1) - fps_text = Font(Fonts.TITLE3, 20).render(str(fps), (255, 255, 255)) + fps_text = Font(Fonts.TITLE3, 32).render(str(fps), CONST.COL_WHITE) - CONFIG.surface.blit(fps_text, (585 + CONFIG.camera_x, 10 + CONFIG.camera_y)) + CONFIG.surface.blit(fps_text, (870 + CONFIG.camera_x, 15 + CONFIG.camera_y)) # endregion CONFIG.update_screen() @@ -350,7 +352,7 @@ def process_ingame(event: pygame.event.Event): TextEvent.NPC = None TextEvent.dialog = None - self.player.set_pos(200, 225) + self.player.set_pos(200, 375) CONFIG.game_dead = False CONFIG.camera_x = 0 diff --git a/screens/intro.py b/screens/intro.py index 173fb14..22460e0 100644 --- a/screens/intro.py +++ b/screens/intro.py @@ -31,7 +31,7 @@ def update(): )) }, "walk", - position=(-250, 320), + position=(-250, 480), scale=0.4, ) ) @@ -74,11 +74,11 @@ def update(): count = 0 player_icon.sprites.get_sprite_handler().sprite.update() # 스프라이트 애니메이션 업데이트 - player_icon.move_x(0.8) # 0.8의 속도만큼 X 좌표로 움직임 + player_icon.move_x(1.2) # 1.2의 속도만큼 X 좌표로 이동 player_icon.render() # 렌더링 - title = Font(Fonts.TITLE3, 40).render(text, CONST.COL_WHITE) # 로고 폰트 렌더링 - title_rect = title.get_rect(center=(320, 180)) # 로고의 좌표 & 크기 (Rect) 가져오기 + title = Font(Fonts.TITLE3, 60).render(text, CONST.COL_WHITE) # 로고 폰트 렌더링 + title_rect = title.get_rect(center=(480, 270)) # 로고의 좌표 & 크기 (Rect) 가져오기 CONFIG.surface.blit(title, title_rect) # 로고를 화면에 렌더링 CONFIG.update_screen() # 업스케일링 diff --git a/screens/menu.py b/screens/menu.py index fa1622f..94a64a9 100644 --- a/screens/menu.py +++ b/screens/menu.py @@ -18,6 +18,7 @@ def process_menu(event: pygame.event.Event): """인게임 이벤트 처리용 (process() child 함수)""" global reload nonlocal need_to_exit + ctrl = pygame.key.get_mods() & pygame.K_LCTRL # ctrl 키 누르는 여부 match event.type: @@ -53,37 +54,41 @@ def process_menu(event: pygame.event.Event): mixer.music.set_volume(SFX.volume) mixer.music.play(-1) + background = pygame.image.load("assets/images/background_menu.png") + background = pygame.transform.scale(background, CONST.SCREEN_SIZE) + while CONFIG.is_running and not need_to_exit: CONFIG.clock.tick(CONFIG.FPS) - CONFIG.surface.fill(CONST.COL_MAIN_BACKGROUND_BLUE) + CONFIG.surface.blit(background, (0, 0)) mouse_pos = CONFIG.get_mouse_pos() title = pygame.image.load("assets/images/menu_title.png") - title = pygame.transform.scale(title, (242, 96)) + title = pygame.transform.scale_by(title, 0.6) button_play_image = pygame.image.load("assets/images/menu_play_rect.png") - button_play_image = pygame.transform.scale(button_play_image, (210, 50)) + button_play_image = pygame.transform.scale(button_play_image, (300, 80)) button_play = Button( image=button_play_image, - pos=(320, 250), + pos=(478, 380), text_input="시작", - font=Font(Fonts.TITLE2, 40).to_pygame(), + font=Font(Fonts.TITLE2, 60).to_pygame(), base_color="#ffffff", hovering_color="White", ) button_settings_image = pygame.image.load( - "assets/images/button_settings_50px.png" + "assets/images/button_settings.png" ) - button_settings = Button(image=button_settings_image, pos=(400, 315)) + button_settings_image = pygame.transform.scale_by(button_settings_image, 0.4) + button_settings = Button(image=button_settings_image, pos=(588, 480)) button_exit_image = pygame.image.load("assets/images/menu_play_rect.png") - button_exit_image = pygame.transform.scale(button_exit_image, (150, 50)) + button_exit_image = pygame.transform.scale(button_exit_image, (200, 80)) button_exit = Button( image=button_exit_image, - pos=(290, 315), + pos=(428, 480), text_input="종료", - font=Font(Fonts.TITLE2, 30).to_pygame(), + font=Font(Fonts.TITLE2, 50).to_pygame(), base_color="#ffffff", hovering_color="White", ) @@ -92,7 +97,7 @@ def process_menu(event: pygame.event.Event): button.change_color(mouse_pos) button.update(CONFIG.surface) - CONFIG.surface.blit(title, title.get_rect(center=(320, 100))) + CONFIG.surface.blit(title, title.get_rect(center=(480, 140))) CONFIG.update_screen() process(process_menu) diff --git a/screens/pause_menu.py b/screens/pause_menu.py index 88a4d15..78e6e0a 100644 --- a/screens/pause_menu.py +++ b/screens/pause_menu.py @@ -79,32 +79,34 @@ def process_menu(event: pygame.event.Event): # ESC 화면 배경 background = pygame.image.load("assets/images/status3.png") - background = pygame.transform.scale_by(background, 0.2) # 이미지 스케일링 + background = pygame.transform.scale_by(background, 0.35) # 이미지 스케일링 background = pygame.transform.rotate(background, 90) # 이미지를 시계방향으로 90도만큼 회전 - background_rect = background.get_rect(center=(320 + CONFIG.camera_x, 180 + CONFIG.camera_y)) # 카메라 좌표 보정 + background_rect = background.get_rect(center=(480 + CONFIG.camera_x, 270 + CONFIG.camera_y)) # 카메라 좌표 보정 # 버튼: 돌아가기 button_play_image = pygame.image.load("assets/images/button_play.png") - button_play_image = pygame.transform.scale_by(button_play_image, 0.2) # 이미지 스케일링 - button_play = Button(image=button_play_image, pos=(290, 140)) + button_play_image = pygame.transform.scale_by(button_play_image, 0.4) # 이미지 스케일링 + button_play = Button(image=button_play_image, pos=(425, 216)) # 버튼: 설정 button_settings_image = pygame.image.load("assets/images/button_settings.png") - button_settings_image = pygame.transform.scale_by(button_settings_image, 0.2) # 이미지 스케일링 - button_settings = Button(image=button_settings_image, pos=(350, 140)) + button_settings_image = pygame.transform.scale_by(button_settings_image, 0.4) # 이미지 스케일링 + button_settings = Button(image=button_settings_image, pos=(531, 216)) # 버튼: 전체화면 / 창모드 button_fullscreen_image = pygame.image.load("assets/images/button_fullscreen.png") - button_fullscreen = Button(image=button_fullscreen_image, pos=(260, 200)) + button_fullscreen_image = pygame.transform.scale_by(button_fullscreen_image, 2) + button_fullscreen = Button(image=button_fullscreen_image, pos=(373, 320)) # 버튼: 음소거 / 음소거 해제 button_unmute_image = pygame.image.load("assets/images/button_unmute.png") - button_unmute_image = pygame.transform.scale_by(button_unmute_image, 0.2) # 이미지 스케일링 - button_unmute = Button(image=button_unmute_image, pos=(320, 200)) + button_unmute_image = pygame.transform.scale_by(button_unmute_image, 0.4) # 이미지 스케일링 + button_unmute = Button(image=button_unmute_image, pos=(478, 320)) # 버튼: 메뉴화면으로 나가기 button_exit_image = pygame.image.load("assets/images/button_exit.png") - button_exit = Button(image=button_exit_image, pos=(380, 200)) + button_exit_image = pygame.transform.scale_by(button_exit_image, 2) + button_exit = Button(image=button_exit_image, pos=(585, 320)) while CONFIG.is_running and not need_to_exit: CONFIG.clock.tick(CONFIG.FPS) @@ -118,6 +120,7 @@ def process_menu(event: pygame.event.Event): else "assets/images/button_fullscreen.png" ) image = pygame.image.load(path) + image = pygame.transform.scale_by(image, 2) # 이미지 스케일링 button_fullscreen.change_image(image) # 맞는 값에 맞춰 이미지 변경 @@ -128,7 +131,7 @@ def process_menu(event: pygame.event.Event): else "assets/images/button_unmute.png" ) image = pygame.image.load(path) - image = pygame.transform.scale_by(image, 0.2) # 이미지 스케일링 + image = pygame.transform.scale_by(image, 0.4) # 이미지 스케일링 button_unmute.change_image(image) # 맞는 값에 맞춰 이미지 변경 diff --git a/screens/settings.py b/screens/settings.py index 17575ac..145d4af 100644 --- a/screens/settings.py +++ b/screens/settings.py @@ -40,12 +40,12 @@ def process_menu(event: pygame.event.Event): if button_resolution_prev.check_for_input(mouse_pos): # 화면/이전 if resolutions_index > 0: resolutions_index -= 1 - resolution = resolutions[resolutions_index] + resolution = CONFIG.resolutions[resolutions_index] if button_resolution_next.check_for_input(mouse_pos): # 화면/다음 - if resolutions_index < len(resolutions) - 1: + if resolutions_index < len(CONFIG.resolutions) - 1: resolutions_index += 1 - resolution = resolutions[resolutions_index] + resolution = CONFIG.resolutions[resolutions_index] if button_resolution_full.check_for_input(mouse_pos): # 전체화면 is_fullscreen = not is_fullscreen @@ -56,7 +56,7 @@ def process_menu(event: pygame.event.Event): else "assets/images/button_unchecked.png" ) image = pygame.image.load(path) - image = pygame.transform.scale_by(image, 0.2) # 이미지 스케일링 + image = pygame.transform.scale_by(image, 0.4) # 이미지 스케일링 button_resolution_full.change_image(image) # 이미지 변경 @@ -69,7 +69,7 @@ def process_menu(event: pygame.event.Event): else "assets/images/button_unchecked.png" ) image = pygame.image.load(path) - image = pygame.transform.scale_by(image, 0.2) # 이미지 스케일링 + image = pygame.transform.scale_by(image, 0.4) # 이미지 스케일링 button_fps.change_image(image) # 이미지 변경 @@ -102,43 +102,35 @@ def process_menu(event: pygame.event.Event): global need_to_exit surface_recovered = CONFIG.surface.copy() # 렌더링한 화면 복사 후 백업 - resolution: tuple[int, int] = tuple(CONFIG.window_size) # 현재 해상도 + resolution = CONFIG.window_size # 현재 해상도 is_fullscreen = CONFIG.is_fullscreen # 현재 전체화면 여부 fps = CONFIG.game_fps # 현재 FPS 표시 여부 volume = SFX.volume # 현재 음량 - - resolutions: list[tuple[int, int]] = [ # 해상도 크기 모음 - (640, 360), - (1280, 720), - (1920, 1080), - (2560, 1440), - (3840, 2160), - ] - resolutions_index = resolutions.index(tuple(CONFIG.window_size)) # 현재 해상도를 resolutions 중에서 찾고 index 반환 + resolutions_index = CONFIG.resolutions.index(CONFIG.window_size) # 현재 해상도를 resolutions 중에서 찾고 index 반환 # 설정창 배경 background = pygame.image.load("assets/images/status3.png") - background = pygame.transform.scale_by(background, 0.25) - background = pygame.transform.scale(background, (background.get_width(), 300)) # 설정 UI에 맞게 스케일링 - background_rect = background.get_rect(center=(320 + CONFIG.camera_x, 180 + CONFIG.camera_y)) # 카메라 좌표 보정 + background = pygame.transform.scale_by(background, 0.45) + background = pygame.transform.scale(background, (background.get_width(), 500)) # 설정 UI에 맞게 스케일링 + background_rect = background.get_rect(center=(480 + CONFIG.camera_x, 270 + CONFIG.camera_y)) # 카메라 좌표 보정 # 텍스트: 화면 - surface_resolution_2 = Font(Fonts.TITLE2, 18).render("화면", (255, 255, 255)) + surface_resolution_2 = Font(Fonts.TITLE2, 36).render("화면", CONST.COL_WHITE) # 화면 / 해상도: 이전 button_resolution_prev_image = pygame.image.load("assets/images/arrow_left.png") button_resolution_prev_image = pygame.transform.scale_by( - button_resolution_prev_image, 0.2 + button_resolution_prev_image, 0.3 ) - button_resolution_prev = Button(image=button_resolution_prev_image, pos=(250, 90)) + button_resolution_prev = Button(image=button_resolution_prev_image, pos=(340, 110)) # 화면 / 해상도: 다음 button_resolution_next_image = pygame.image.load("assets/images/arrow_right.png") button_resolution_next_image = pygame.transform.scale_by( - button_resolution_next_image, 0.2 + button_resolution_next_image, 0.3 ) - button_resolution_next = Button(image=button_resolution_next_image, pos=(380, 90)) + button_resolution_next = Button(image=button_resolution_next_image, pos=(616, 110)) # 화면 / 전체화면 button_resolution_full_path = ( @@ -148,14 +140,14 @@ def process_menu(event: pygame.event.Event): ) button_resolution_full_image = pygame.image.load(button_resolution_full_path) button_resolution_full_image = pygame.transform.scale_by( - button_resolution_full_image, 0.2 + button_resolution_full_image, 0.4 ) button_resolution_full = Button( image=button_resolution_full_image, - pos=(250, 125), - text_offset=(50, 0), + pos=(350, 170), + text_offset=(100, 0), text_input="전체화면", - font=Font(Fonts.ILLUST, 16).to_pygame(), + font=Font(Fonts.ILLUST, 32).to_pygame(), base_color="#ffffff", hovering_color="White", ) @@ -167,50 +159,50 @@ def process_menu(event: pygame.event.Event): else "assets/images/button_unchecked.png" ) button_fps_image = pygame.image.load(button_fps_path) - button_fps_image = pygame.transform.scale_by(button_fps_image, 0.2) + button_fps_image = pygame.transform.scale_by(button_fps_image, 0.4) button_fps = Button( image=button_fps_image, - pos=(250, 150), - text_offset=(50, 0), + pos=(350, 225), + text_offset=(100, 0), text_input="FPS 표시", - font=Font(Fonts.ILLUST, 16).to_pygame(), + font=Font(Fonts.ILLUST, 32).to_pygame(), base_color="#ffffff", hovering_color="White", ) # 텍스트: 소리 - surface_audio = Font(Fonts.TITLE2, 18).render("소리", (255, 255, 255)) + surface_audio = Font(Fonts.TITLE2, 36).render("소리", CONST.COL_WHITE) # 소리 / 음량: 이전 button_audio_prev_image = pygame.image.load("assets/images/arrow_left.png") - button_audio_prev_image = pygame.transform.scale_by(button_audio_prev_image, 0.2) - button_audio_prev = Button(image=button_audio_prev_image, pos=(250, 220)) + button_audio_prev_image = pygame.transform.scale_by(button_audio_prev_image, 0.3) + button_audio_prev = Button(image=button_audio_prev_image, pos=(340, 340)) # 소리 / 음량: 다음 button_audio_next_image = pygame.image.load("assets/images/arrow_right.png") - button_audio_next_image = pygame.transform.scale_by(button_audio_next_image, 0.2) - button_audio_next = Button(image=button_audio_next_image, pos=(380, 220)) + button_audio_next_image = pygame.transform.scale_by(button_audio_next_image, 0.3) + button_audio_next = Button(image=button_audio_next_image, pos=(616, 340)) # 버튼: 취소 button_cancel_image = pygame.image.load("assets/images/menu_play_rect.png") - button_cancel_image = pygame.transform.scale(button_cancel_image, (40, 20)) + button_cancel_image = pygame.transform.scale(button_cancel_image, (100, 50)) button_cancel = Button( image=button_cancel_image, - pos=(350, 305), + pos=(485, 460), text_input="취소", - font=Font(Fonts.OPTION, 20).to_pygame(), + font=Font(Fonts.OPTION, 50).to_pygame(), base_color="#ffffff", hovering_color="White", ) # 버튼: 확인 button_ok_image = pygame.image.load("assets/images/menu_play_rect.png") - button_ok_image = pygame.transform.scale(button_ok_image, (40, 20)) + button_ok_image = pygame.transform.scale(button_ok_image, (100, 50)) button_ok = Button( image=button_ok_image, - pos=(395, 305), + pos=(600, 460), text_input="확인", - font=Font(Fonts.OPTION, 20).to_pygame(), + font=Font(Fonts.OPTION, 50).to_pygame(), base_color="#ffffff", hovering_color="White", ) @@ -220,24 +212,24 @@ def process_menu(event: pygame.event.Event): mouse_pos = CONFIG.get_mouse_pos() # 업스케일링 및 카메라 좌표가 보정된 마우스 커서 좌표 가져오기 - surface_resolution = Font(Fonts.ILLUST, 18).render( # 해상도 텍스트 폰트 렌더링 + surface_resolution = Font(Fonts.ILLUST, 36).render( # 해상도 텍스트 폰트 렌더링 CONFIG.resolution_to_str(resolution), CONST.COL_WHITE ) - surface_audio_text = Font(Fonts.ILLUST, 18).render( # 음량 텍스트 폰트 렌더링 - str(round(volume, 1)), CONST.COL_WHITE + surface_audio_text = Font(Fonts.ILLUST, 36).render( # 음량 텍스트 폰트 렌더링 (백분율로 표시) + str(int(round(volume, 1) * 100)) + "%", CONST.COL_WHITE ) # 렌더링 (카메라 좌표 보정) CONFIG.surface.blit(background, background_rect) CONFIG.surface.blit( - surface_resolution, surface_resolution.get_rect(center=(315 + CONFIG.camera_x, 90 + CONFIG.camera_y)) + surface_resolution, surface_resolution.get_rect(center=(480 + CONFIG.camera_x, 110 + CONFIG.camera_y)) ) CONFIG.surface.blit( - surface_resolution_2, surface_resolution_2.get_rect(center=(245 + CONFIG.camera_x, 50 + CONFIG.camera_y)) + surface_resolution_2, surface_resolution_2.get_rect(center=(340 + CONFIG.camera_x, 60 + CONFIG.camera_y)) ) - CONFIG.surface.blit(surface_audio, surface_audio.get_rect(center=(244 + CONFIG.camera_x, 185 + CONFIG.camera_y))) + CONFIG.surface.blit(surface_audio, surface_audio.get_rect(center=(340 + CONFIG.camera_x, 290 + CONFIG.camera_y))) CONFIG.surface.blit( - surface_audio_text, surface_audio_text.get_rect(center=(315 + CONFIG.camera_x, 220 + CONFIG.camera_y)) + surface_audio_text, surface_audio_text.get_rect(center=(480 + CONFIG.camera_x, 340 + CONFIG.camera_y)) ) for button in [