Page 1 of 1

Screenshots in Ren'py

Posted: Fri Feb 14, 2014 5:09 pm
by meticulo
Hey Ren’Py Community,

I am trying to use a common python module in windows to take screenshots, PIL or Python Imaging Library. Basically, you call PIl.ImageGrabber.grab() to take a screenshot. Now when I take a screenshot with ren’py in windowed mode, it successfully takes a screenshot. However, when I take a screenshot in full screen mode, it does not take a screenshot of the ren’py screen but takes a picture of the windows desktop or just a black screen. Generally the screenshots are black but sometimes they are cropped.

Now, I would love to use the ‘renpy.takescreenshot()’ function, however, it saves it in a compressed file (the normal save files). I was wondering if there is a way I can get renpy to just dump a screenshot file, what command would I have to do? What python function would I need to write and where would I need to look?

Any and all advice on this is appreciated.

-Zeke

Re: Screenshots in Ren'py

Posted: Fri Feb 14, 2014 11:23 pm
by Asceai

Re: Screenshots in Ren'py

Posted: Sat Feb 15, 2014 5:50 am
by Kosyne
I can't remember, but since Ren'Py uses Pygame, you may be able to use one of it's built in functions to do this, discussed here.

Edit: This is also double-posted into the questions forum, so this topic should probably be deleted.

Re: Screenshots in Ren'py

Posted: Sat Feb 15, 2014 7:21 am
by Asceai
I feel like the hardware rendering might be a bit separate from the pygame stuff and the pygame stuff might not have access to an accurate picture of the screen state. I could be entirely wrong, but I think you would want to use renpy.screenshot unless you have a very specific requirement, like needing to take a screenshot in memory.

EDIT: It also looks like renpy has some internal functions for doing this, which you could use if you're feeling daring. renpy.game.interface.get_screenshot() after you've used take_screenshot..

Being able to take a screenshot and keep it around as a displayable would be kind of cool though. Possible feature request?

Re: Screenshots in Ren'py

Posted: Sat Feb 15, 2014 10:59 am
by PyTom
Asceai wrote:I feel like the hardware rendering might be a bit separate from the pygame stuff and the pygame stuff might not have access to an accurate picture of the screen state. I could be entirely wrong, but I think you would want to use renpy.screenshot unless you have a very specific requirement, like needing to take a screenshot in memory.
That's correct. You very likely want to use renpy.screenshot to save things to disk.
Being able to take a screenshot and keep it around as a displayable would be kind of cool though. Possible feature request?
FileCurrentScreenshot() displays the screenshot taken by take_screenshot.

Re: Screenshots in Ren'py

Posted: Sat Feb 15, 2014 11:13 am
by Asceai
PyTom wrote:FileCurrentScreenshot() displays the screenshot taken by take_screenshot.
6.17 I'm guessing?

Anyway, it sounds really good. I'm guessing we can't copy it and have the old screenshot stay in there, but can probably render it and copy the render.