[SOLVED] Resizing Screenshot Image Thumbnail on Save/Load Screens?

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
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

[SOLVED] Resizing Screenshot Image Thumbnail on Save/Load Screens?

#1 Post by sasquatchii »

Hi! I am trying to make my thumbnails on my save / load screens much smaller, to fit the thumbnail size that I need. Here's what my save/load screens currently look like:

Image

Here's the bit of code I'm using (but doesn't seem to be working) to resize the thumbnails:

Code: Select all

init -2 python:
    config.thumbnail_width = 50
    config.thumbnail_height = 50
And here's the entire bit of code for the save / load screens that I'm currently working with:

Code: Select all

screen save():

    tag menu

        

    
    imagemap:
        ground "gui/save-inactive.png"
        hover "gui/save-active.png"
        selected_idle "gui/save-active.png"
        alpha True
          
        hotspot (567, 60, 506, 173) clicked FileSave(1):
            use load_save_slot(number=1)

        hotspot (567, 284, 506, 173) clicked FileSave(2):
            use load_save_slot(number=2)

        hotspot (567, 520, 506, 173) clicked FileSave(3):
            use load_save_slot(number=3)
            
        hotspot (567, 738, 506, 173) clicked FileSave(4):
            use load_save_slot(number=4)

        hotspot (1242, 60, 506, 173) clicked FileSave(5):
            use load_save_slot(number=5)

        hotspot (1242, 284, 506, 173) clicked FileSave(6):
            use load_save_slot(number=6)
            
        hotspot (1242, 520, 506, 173) clicked FileSave(7):
            use load_save_slot(number=7)
            
        hotspot (1242, 738, 506, 173) clicked FileSave(8):
            use load_save_slot(number=8)

            
            
        hotspot (828, 942, 55, 55) action FilePage(1)
        hotspot (936, 942, 55, 55) action FilePage(2)
 


        hotspot (90, 424, 304, 62) action Return()
        hotspot (90, 502, 304, 62) action ShowMenu('load')
        hotspot (90, 581, 304, 62) action ShowMenu('preferences')
        hotspot (90, 659, 304, 62) action MainMenu()
        hotspot (90, 738, 304, 62) action Quit(confirm=not main_menu)


            


screen load():

    tag menu

    if main_menu:
        add "bg/T7.jpg"
            


    imagemap:
        ground "gui/load-inactive.png"
        hover "gui/load-active.png"
        selected_idle "gui/load-active.png"
        alpha True
          
        hotspot (567, 60, 506, 173) clicked FileLoad(1):
            use load_save_slot(number=1)

        hotspot (567, 284, 506, 173) clicked FileLoad(2):
            use load_save_slot(number=2)

        hotspot (567, 520, 506, 173) clicked FileLoad(3):
            use load_save_slot(number=3)
            
        hotspot (567, 738, 506, 173) clicked FileLoad(4):
            use load_save_slot(number=4)

        hotspot (1242, 60, 506, 173) clicked FileLoad(5):
            use load_save_slot(number=5)

        hotspot (1242, 284, 506, 173) clicked FileLoad(6):
            use load_save_slot(number=6)
            
        hotspot (1242, 520, 506, 173) clicked FileLoad(7):
            use load_save_slot(number=7)
            
        hotspot (1242, 738, 506, 173) clicked FileLoad(8):
            use load_save_slot(number=8)
            
        
        
        hotspot (828, 942, 55, 55) action FilePage(1)
        hotspot (936, 942, 55, 55) action FilePage(2)
        
        hotspot (90, 424, 304, 62) action Return()
        hotspot (90, 502, 304, 62) action ShowMenu('save')
        hotspot (90, 581, 304, 62) action ShowMenu('preferences')
        hotspot (90, 659, 304, 62) action MainMenu()
        hotspot (90, 738, 304, 62) action Quit(confirm=not main_menu)
        




screen file_slots(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    use game_menu(title):

        fixed:

            ## This ensures the input will get the enter event before any of the
            ## buttons do.
            order_reverse True

            ## The page name, which can be edited by clicking on a button.
            button:
                style "page_label"

                key_events True
                xalign 0.7
                action page_name_value.Toggle()


            ## Buttons to access other pages.
            hbox:
                style_prefix "page"

                xalign 0.5
                yalign 1.0

                spacing gui.page_spacing

                textbutton _("<") action FilePagePrevious()

                if config.has_autosave:
                    textbutton _("{#auto_page}A") action FilePage("auto")

                if config.has_quicksave:
                    textbutton _("{#quick_page}Q") action FilePage("quick")

                ## range(1, 10) gives the numbers from 1 to 9.
                for page in range(1, 10):
                    textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext()
                



style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text

style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text

style page_label:
    xpadding 50
    ypadding 3

style page_label_text:
    text_align 0.5
    layout "subtitle"
    hover_color gui.hover_color
    idle_color gui.idle_color

style page_button:
    properties gui.button_properties("page_button")

style page_button_text:
    properties gui.button_text_properties("page_button")

style slot_button:
    properties gui.button_properties("slot_button")

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


    add FileScreenshot(number) xpos 3 ypos 0
    
    text FileTime(number, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("")):
        style "slot_time_text" ypos 234 xpos 194

    text FileSaveName(number):
        style "slot_name_text"
    
init -2 python:
    config.thumbnail_width = -200
    config.thumbnail_height = -200
Any ideas or help are much appreciated!!
Last edited by sasquatchii on Sat Jan 27, 2018 4:37 pm, edited 1 time in total.
ImageImage

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: Resizing Screenshot Image Thumbnail on Save/Load Screens?

#2 Post by Empish »

Where you say add FileScreenshot, try adding in size stuff

Code: Select all

add Filescreenshot(number) size(50,50) xpos 3 ypos 0

User avatar
SypherZent
Veteran
Posts: 362
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

Re: Resizing Screenshot Image Thumbnail on Save/Load Screens?

#3 Post by SypherZent »

The method recommended by Empish works for me, just tested. ^^

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Resizing Screenshot Image Thumbnail on Save/Load Screens?

#4 Post by sasquatchii »

Empish wrote: Sat Jan 27, 2018 1:20 pm Where you say add FileScreenshot, try adding in size stuff

Code: Select all

add Filescreenshot(number) size(50,50) xpos 3 ypos 0
That worked!! Thank you so much!
ImageImage

User avatar
Steamgirl
Veteran
Posts: 322
Joined: Sat Jul 28, 2012 4:39 am
Completed: My Cup of Coffee, Queen at Arms (co-wrote a battle scene)
Projects: Stranded Hearts, Emma: A Lady's Maid
Deviantart: steamgirlgame
Contact:

Re: Resizing Screenshot Image Thumbnail on Save/Load Screens?

#5 Post by Steamgirl »

I have the config.thumbnail_width / config.thumbnail_height in my options.rpy and that seems to work. It doesn't like negative numbers and gives me an error if I try to make them negative.

I assume you weren't getting the same error because you have -200 in your code? If so, that would suggest to me that value isn't getting passed to the FileScreenshot() function. Perhaps something else is setting the thumbnail width/height elsewhere?

Post Reply

Who is online

Users browsing this forum: craboozled, Semrush [Bot]