Skip to content

Commit

Permalink
Added favicon to pygame window
Browse files Browse the repository at this point in the history
  • Loading branch information
sillypantscoder committed May 12, 2022
1 parent 58b79e7 commit 0a41443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get(path):
def post(path, body):
if path.split("/")[1].isdigit():
gamepath = "/".join(path.split("/")[2:])
print(f"POST to game {path.split('/')[1]} at /{gamepath}")
#print(f"POST to game {path.split('/')[1]} at /{gamepath}")
gameno = int(path.split("/")[1])
game = activeGames[gameno]
res = game.post("/" + gamepath, body, gameno)
Expand Down Expand Up @@ -149,6 +149,7 @@ def async_pygame():
screensize = [500, 500]
screen = pygame.display.set_mode(screensize, pygame.RESIZABLE)
pygame.display.set_caption("Word Pictionary")
pygame.display.set_icon(pygame.image.load("window.ico"))
font = pygame.font.SysFont(pygame.font.get_default_font(), 20)
fontheight = font.render("0", True, (0, 0, 0)).get_height()
# Main loop
Expand All @@ -173,6 +174,7 @@ def async_pygame():
for p in clickpos:
if resultsrect.collidepoint(*p):
activeGames[i].drawingProgress -= 1
if activeGames[i].drawingProgress < 0: activeGames[i].drawingProgress += 4
r = font.render(f"Close this window to stop the server", True, (0, 0, 0))
screen.blit(r, (0, (i + 2) * fontheight))
r = font.render(f"Show results: {'Yes' if show_results else 'No'}", True, (0, 0, 0))
Expand Down
Binary file added window.ico
Binary file not shown.

0 comments on commit 0a41443

Please sign in to comment.