Page 1 of 1

Question About "add FileScreenshot"

Posted: Mon Oct 08, 2018 1:44 pm
by parttimestorier
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 1222 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)]

Re: Question About "add FileScreenshot"

Posted: Mon Oct 08, 2018 2:26 pm
by Imperf3kt
You're looking in the wrong place.
Open gui.rpy and find the section dealing with thumbnails. Adjust the ones for save slots.

Re: Question About "add FileScreenshot"

Posted: Wed Oct 10, 2018 11:46 am
by parttimestorier
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?

Re: Question About "add FileScreenshot"

Posted: Wed Oct 10, 2018 12:44 pm
by Scribbles
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

Re: Question About "add FileScreenshot"

Posted: Wed Oct 10, 2018 5:06 pm
by parttimestorier
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.

Re: Question About "add FileScreenshot"

Posted: Wed Oct 10, 2018 8:49 pm
by philat
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.

Re: Question About "add FileScreenshot"

Posted: Wed Oct 10, 2018 9:25 pm
by parttimestorier
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. :)