python – How to resize a surface in Pygame?

There is no way to do this automatically, so if you want some kind of automation for resizing the surface, you have to write your own wrapper class. pygame.Rect, which has a rectangle, takes a surface and resizes the surface when a wrapper method is called.

The resize function you are looking for is pygame.transform.scale. If you pass it a new surface and size, a new surface will be returned or the result will be placed in an already created surface (this is faster).