Screenshots in Ren'py

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
meticulo
Newbie
Posts: 8
Joined: Fri Feb 14, 2014 3:03 pm
Contact:

Screenshots in Ren'py

#1 Post 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
Attachments
what the screenshot actually looks like
what the screenshot actually looks like
cropped.png (679 Bytes) Viewed 7399 times
what the screenshot should look like
what the screenshot should look like

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Screenshots in Ren'py

#2 Post by Asceai »


User avatar
Kosyne
Newbie
Posts: 4
Joined: Sun May 27, 2012 4:14 am
Organization: Kaos Team
Location: n. A particular place or position.
Contact:

Re: Screenshots in Ren'py

#3 Post 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.

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Screenshots in Ren'py

#4 Post 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?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Screenshots in Ren'py

#5 Post 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.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Screenshots in Ren'py

#6 Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users