Overview

Pygame 2.3, released on April 26, 2023, improves window management with new positioning and resizing options.

Main Features

Window management

The pygame.Window module offers advanced control over window properties: position, size, fullscreen mode, and decoration.

python
import pygame

pygame.init()
screen = pygame.display.set_mode(
    (800, 600), pygame.RESIZABLE
)
pygame.display.set_caption('Pygame 2.3 - Window')

running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        elif event.type == pygame.VIDEORESIZE:
            print(f'New size: {event.size}')
    screen.fill((40, 40, 80))
    pygame.display.flip()
pygame.quit()

Rendering improvements

Graphics rendering benefits from optimizations for blit operations and surface transformations.

python
import pygame

pygame.init()
screen = pygame.display.set_mode((640, 480))

# Create surfaces with transparency
surface = pygame.Surface((100, 100), pygame.SRCALPHA)
pygame.draw.circle(surface, (255, 0, 0, 128), (50, 50), 50)

# Optimized transformation
scaled = pygame.transform.smoothscale(surface, (200, 200))
screen.blit(scaled, (220, 140))
pygame.display.flip()

Sources