How to take screenshot of certain part of screen in Pygame

后端 未结 4 1440
感动是毒
感动是毒 2021-01-04 23:26

Is there a way I can take a screenshot of the right half of my pygame window?

I\'m making a game using pygame and I need to take a snapshot of the screen but not the

4条回答
  •  佛祖请我去吃肉
    2021-01-05 00:12

    I would do something like:

    example = pygame.Surface(screen.get_width()/2, 0)

    Then later on when you want to take the screenshot do:

    pygame.image.save(example, "example.jpg")

提交回复
热议问题