From 6468da379bed07ef6c6cc4ba1131a8c10fbcb6ef Mon Sep 17 00:00:00 2001 From: telekrex Date: Sat, 30 Mar 2024 11:19:07 -0400 Subject: [PATCH] fix noconsole in build scripts --- Colorbase.py | 18 +++++++++++++++--- build-linux.sh | 2 +- build-windows.cmd | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Colorbase.py b/Colorbase.py index 755be30..e3b03ea 100644 --- a/Colorbase.py +++ b/Colorbase.py @@ -10,8 +10,9 @@ pygame.init() pygame.display.set_caption('Colorbase R2') monitor = (pygame.display.Info().current_w, pygame.display.Info().current_h) +fullscreen = False clock = pygame.time.Clock() # start pygame clock -void = pygame.display.set_mode(monitor, pygame.RESIZABLE) +void = pygame.display.set_mode((200, 200), pygame.RESIZABLE) colors = ['white', 'blue', 'green', 'red', 'yellow', 'cyan', 'magenta', 'gray', 'black'] index = 0 # set index of color selection @@ -32,15 +33,26 @@ def update_display(): for event in pygame.event.get(): # checking for input events if event.type == pygame.KEYDOWN: + if event.key == pygame.K_SPACE: + # on SPACE, toggle fullscreen/ + # resizable windows size + if fullscreen == False: + fullscreen = True + void = pygame.display.set_mode(monitor, pygame.FULLSCREEN) + else: + fullscreen = False + void = pygame.display.set_mode((200, 200), pygame.RESIZABLE) + update_display() if event.key == pygame.K_RETURN: - # on ENTER (aka RETURN) + # on ENTER (aka RETURN), + # change index, thus color if index == len(colors)-1: index = 0 else: index += 1 update_display() if event.key == pygame.K_ESCAPE: - # on ESCAPE + # on ESCAPE, exit application r = False sys.exit() pygame.display.flip() \ No newline at end of file diff --git a/build-linux.sh b/build-linux.sh index 44f8290..5959851 100644 --- a/build-linux.sh +++ b/build-linux.sh @@ -1,2 +1,2 @@ #!/bin/bash -python3 -m PyInstaller --onefile Colorbase.py -noconsole \ No newline at end of file +python3 -m PyInstaller --onefile --noconsole Colorbase.py \ No newline at end of file diff --git a/build-windows.cmd b/build-windows.cmd index 3fce701..1370674 100644 --- a/build-windows.cmd +++ b/build-windows.cmd @@ -1 +1 @@ -python -m PyInstaller --onefile Colorbase.py -noconsole \ No newline at end of file +python -m PyInstaller --onefile --noconsole Colorbase.py \ No newline at end of file