How to grab frames from an emulator while it's running?
sayakpaul opened this issue · 2 comments
sayakpaul commented
Hi folks.
pyboy
works like a charm. I am a beginner in it and I was wondering if it's possible to grab each frame (or even at a certain frame-rate) from the while not pyboy.tick():
block. Any directions along these lines would be very helpful.
Baekalfen commented
Yes, very much so!
from pyboy import PyBoy
p = PyBoy('ROMS/Tetris.gb')
screen = p.botsupport_manager().screen()
while not pyboy.tick():
screen.screen_image().show()
# screen.screen_image().save(...)
screen.screen_image() provides a PIL Image for you.
sayakpaul commented
Very nice!
Thank you for your prompt response.