Baekalfen/PyBoy

Pyboy screenshotting function?

mapl-e opened this issue · 2 comments

mapl-e commented

Is there any function that allows me to take a screenshot of the running game? I would be really thankful if anyone helps.

It's actually on the frontpage in the readme:

from pyboy import WindowEvent

pyboy.send_input(WindowEvent.PRESS_ARROW_DOWN)
pyboy.tick() # Process one frame to let the game register the input
pyboy.send_input(WindowEvent.RELEASE_ARROW_DOWN)

pil_image = pyboy.screen_image()
pil_image.save('screenshot.png')```
mapl-e commented

Does this take a screenshot of the game tab? Or does it take a screenshot of the whole system? Thank you for your help btw!!