Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
/ colorbase Public archive

Commit

Permalink
fix noconsole in build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
telekrex committed Mar 30, 2024
1 parent bda5b33 commit 6468da3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions Colorbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
2 changes: 1 addition & 1 deletion build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
python3 -m PyInstaller --onefile Colorbase.py -noconsole
python3 -m PyInstaller --onefile --noconsole Colorbase.py
2 changes: 1 addition & 1 deletion build-windows.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python -m PyInstaller --onefile Colorbase.py -noconsole
python -m PyInstaller --onefile --noconsole Colorbase.py

0 comments on commit 6468da3

Please sign in to comment.