bluends
bluends

Reputation: 195

How do I make my screen zoom in and out in pygame?

The code: https://pastebin.pl/view/6f60a32d I have tried using opengl and tried putting all of the stuff into a surface, and none of them worked

enter image description here if anyone have any ideas on how to zoom in my game pls help me

Upvotes: 1

Views: 1287

Answers (1)

Rabbid76
Rabbid76

Reputation: 211166

Use pygame.transform.smoothscale() to generate a scaled copy of the display pygame.Surface after drawing the scene:

zoomed_screen = pygame.transform.smoothscale(screen, (new_width, new_height))

Blit the zoomed Surface on the screen

screen.blit(zoomed_screen, ....)

Upvotes: 1

Related Questions