How to add a background image in pygame

Pygame can use the pygame.image module to add background images as follows:

  1. Use pygame.image.load() to load images;
  2. Use pygame.transform.scale() to scale the image;
  3. Use pygame.display.set_mode() to create a new display window;
  4. Use pygame.display.get_surface() to get the window surface;
  5. Use pygame.display.update() to update the window surface;
  6. Use pygame.display.blit() to draw the background image to the window surface.

Guess you like

Origin blog.csdn.net/weixin_35756373/article/details/129605533