Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyboy screenshotting function? #248

Closed
mapl-e opened this issue Jun 9, 2023 · 2 comments
Closed

Pyboy screenshotting function? #248

mapl-e opened this issue Jun 9, 2023 · 2 comments

Comments

@mapl-e
Copy link

mapl-e commented Jun 9, 2023

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

@Baekalfen
Copy link
Owner

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
Copy link
Author

mapl-e commented Jun 14, 2023

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants