Open
Description
Pygame supports creating resizable windows. However, I don't think these are getting passed through from the browser.
Here's an example that works on my desktop, but not through pygbag.
import asyncio
import pygame
def sane_font(width, height):
return pygame.font.Font(None, round(min(height, width) * 0.2))
async def main():
pygame.init()
width = 1280
height = 720
S = pygame.display.set_mode((width, height), pygame.RESIZABLE)
font = sane_font(width, height)
while True:
for event in pygame.event.get():
if event.type == pygame.VIDEORESIZE:
width, height = S.get_size()
font = sane_font(width, height)
S.fill((255, 255, 255))
S.blit(font.render(f"{width} × {height}", True, (0, 0, 0)), (5, 5))
pygame.display.update()
await asyncio.sleep(0)
asyncio.run(main())
Pygbag does well at scaling up non-resizable windows, but where the author's gone to the trouble of handling resizes, crisp graphics would be really nice to have.