Question About "add FileScreenshot"

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
parttimestorier
Regular
Posts: 181
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada
Contact:

Question About "add FileScreenshot"

#1 Post by parttimestorier » Mon Oct 08, 2018 1:44 pm

I'm wondering about my options for modifying the way RenPy shows a small screenshot of the point where you saved on the save/load menu. The GUI I'm using right now isn't really the ideal size I guess - when I look at the save/load menu it looks like the screenshots are a little squished.

Here's what one save slot in the menu looks like:
squished.png
squished.png (71 KiB) Viewed 165 times
Compared to a screenshot in the right resolution:
screenshot0001.png
(Please ignore my bad placeholder background that I made in the Sims 4. Also, here are the creative commons GUI and sprites I'm currently using if anyone is interested.)

Is it possible to somehow modify the "add FileScreenshot" part of the code to avoid this issue? Like maybe making it cut off the sides of the screenshot to make it fit instead of squishing it? Or am I going to need to just do some cumbersome editing of the GUI to give the slots the right dimensions?

Here's the relevant part of the code if that helps:

Code: Select all

screen load_save_slot:
    $ file_text = "%2s. %s\n  %s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot")),
                        FileSaveName(number))

    add FileScreenshot(number) xpos 11 ypos 38
    text file_text xpos 55 ypos 225 size 23 drop_shadow [(1, 2)]
ImageImageImage

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1950
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Question About "add FileScreenshot"

#2 Post by Imperf3kt » Mon Oct 08, 2018 2:26 pm

You're looking in the wrong place.
Open gui.rpy and find the section dealing with thumbnails. Adjust the ones for save slots.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
parttimestorier
Regular
Posts: 181
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada
Contact:

Re: Question About "add FileScreenshot"

#3 Post by parttimestorier » Wed Oct 10, 2018 11:46 am

Imperf3kt wrote:
Mon Oct 08, 2018 2:26 pm
You're looking in the wrong place.
Open gui.rpy and find the section dealing with thumbnails. Adjust the ones for save slots.
Thanks for your help. Unfortunately, I don't actually have a gui.rpy file in this project. I'm using a premade GUI that I guess is older and/or programmed differently (CC GUI 1 from this thread). It came with all the files needed to run it and never had a gui.rpy. I can see the part you're talking about in a different project's gui.rpy though:

Code: Select all

## File Slot Buttons ###########################################################
##
## A file slot button is a special kind of button. It contains a thumbnail
## image, and text describing the contents of the save slot. A save slot uses
## image files in gui/button, like the other kinds of buttons.

## The save slot button.
define gui.slot_button_width = 276
define gui.slot_button_height = 206
define gui.slot_button_borders = Borders(10, 10, 10, 10)
define gui.slot_button_text_size = 14
define gui.slot_button_text_xalign = 0.5
define gui.slot_button_text_idle_color = gui.idle_small_color
define gui.slot_button_text_selected_idle_color = gui.selected_color
define gui.slot_button_text_selected_hover_color = gui.hover_color

## The width and height of thumbnails used by the save slots.
define config.thumbnail_width = 256
define config.thumbnail_height = 144

## The number of columns and rows in the grid of save slots.
define gui.file_slot_cols = 3
define gui.file_slot_rows = 2
So I guess my new question for anyone who can answer it is, how do I add something like that to this other project that doesn't have a gui.rpy? Where would I put it?
ImageImageImage

User avatar
Scribbles
Miko-Class Veteran
Posts: 582
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island
Projects: As We Know It
Organization: Scribble Games
Tumblr: doodlesatbreakfast
Deviantart: breakfastdoodles
itch: scribbles
Location: Georgia
Contact:

Re: Question About "add FileScreenshot"

#4 Post by Scribbles » Wed Oct 10, 2018 12:44 pm

I took a look at the gui code and I think it used the old "legacy gui" which is no longer recommended as a base(...i think). You could strip the assets and put them into a new project, or try to find how to modify screenshot size though i've taken a look at the code and have no idea where or how. since the gui code you got is over 3 years old you may not be able to contact the creator, but you could try that too > < I'm sorry, maybe someone better at this can help but I would really recommend striping out the assets into a new file with the new GUI. I've looked through as a lot of the assets are there so you'd just have to import them and plug them in and thats pretty easy to do with the new gui renpy has
Image - Image

User avatar
parttimestorier
Regular
Posts: 181
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada
Contact:

Re: Question About "add FileScreenshot"

#5 Post by parttimestorier » Wed Oct 10, 2018 5:06 pm

Scribbles wrote:
Wed Oct 10, 2018 12:44 pm
I took a look at the gui code and I think it used the old "legacy gui" which is no longer recommended as a base(...i think). You could strip the assets and put them into a new project, or try to find how to modify screenshot size though i've taken a look at the code and have no idea where or how. since the gui code you got is over 3 years old you may not be able to contact the creator, but you could try that too > < I'm sorry, maybe someone better at this can help but I would really recommend striping out the assets into a new file with the new GUI. I've looked through as a lot of the assets are there so you'd just have to import them and plug them in and thats pretty easy to do with the new gui renpy has
Okay, thanks for taking a look! I can always do that if nothing else works.
ImageImageImage

philat
Eileen-Class Veteran
Posts: 1454
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Question About "add FileScreenshot"

#6 Post by philat » Wed Oct 10, 2018 8:49 pm

config.thumbnail_height/width are just config variables. https://www.renpy.org/doc/html/config.h ... ail_height

They're probably set somewhere in the files you have (ctrl+f is your friend); just change them.

User avatar
parttimestorier
Regular
Posts: 181
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada
Contact:

Re: Question About "add FileScreenshot"

#7 Post by parttimestorier » Wed Oct 10, 2018 9:25 pm

philat wrote:
Wed Oct 10, 2018 8:49 pm
config.thumbnail_height/width are just config variables. https://www.renpy.org/doc/html/config.h ... ail_height

They're probably set somewhere in the files you have (ctrl+f is your friend); just change them.
Oh hey, I found them and got it working! Thanks for pointing that out - I guess it's easy to miss the obvious solution when you're confused and overwhelmed by a bunch of other stuff. And thanks to everyone else who helped out too. :)
ImageImageImage

Post Reply

Who is online

Users browsing this forum: TomDowd