Save Slot Spacing Issues [SOLVED]

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
LiamExe
Regular
Posts: 35
Joined: Thu May 08, 2014 4:58 pm
Projects: Locked Souls
itch: liamexe
Contact:

Save Slot Spacing Issues [SOLVED]

#1 Post by LiamExe »

Hiya there,

Hopefully this is the right place to post such a thing, and apologies if a similar issue has been brought up before, as I tried my best to scour the forum for a solution that might help me.

I'm still new to creating custom screens in Ren'Py, so the solution to this might be really simple, too:

I'm in the middle of creating my save/load screens, and have ran into a frustrating issue where the save slots have a large gap between the columns, which makes working with them really difficult (there's a screenshot of how the issue looks below). I've spent a good few hours poking around with various options such as padding, alignment, offsetting, etc., (both in the style part and in the file_picker screen) but none of it seems to affect the space between the two columns, no matter what I do.

I'll include the code for the file_picker button and file_picker screen just in case you might see something that's interfering and causing the issue that I've missed:

Screen File_Picker

Code: Select all

screen file_picker:

    frame:
        style "file_picker_frame"
        background "ui/prefs/filebase.png"

        has vbox

        # The buttons at the top allow the user to pick a
        # page of files.
        hbox xoffset 480 yoffset 70:
            style_group "file_picker_nav"

            textbutton _("Previous"):
                action FilePagePrevious()

            textbutton _("Auto"):
                action FilePage("auto")

            textbutton _("Quick"):
                action FilePage("quick")

            for i in range(1, 9):
                textbutton str(i):
                    action FilePage(i)

            textbutton _("Next"):
                action FilePageNext()

        $ columns = 2
        $ rows = 5

        # Display a grid of file slots.
        grid columns rows:
            transpose True
            xfill True
            style_group "file_picker"
            xoffset 100
            yoffset 80

            # Display ten file slots, numbered 1 - 10.
            for i in range(1, columns * rows + 1):

                # Each file slot is a button.
                button:
                    action FileAction(i)
                    #xfill True

                    has hbox

                    # Add the screenshot.
                    add FileScreenshot(i)

                    $ file_name = FileSlotName(i, columns * rows)
                    $ file_time = FileTime(i, empty=_("Empty Slot"))
                    $ save_name = FileSaveName(i)

                    text "[file_name]. [file_time!t]\n[save_name!t]"

                    key "save_delete" action FileDelete(i)
Styles

Code: Select all

init -2:
    style file_picker_frame is menu_frame
    style file_picker_nav_button:
        is default
        xpadding 8
    style file_picker_nav_button_text is small_button_text
    style file_picker_button:
        xminimum 375
        xmaximum 375
        yminimum 95
        
    style file_picker_text is large_button_text
Apologies if anything seems a bit messy, since poking at the screen code has been a bit of an experimental process for me while I get to grips with it.

Thanks for taking the time to go through this, and hopefully there's an easy enough solution!
Attachments
Save/Load Spacing Issue
Save/Load Spacing Issue
Last edited by LiamExe on Mon Feb 01, 2016 10:50 pm, edited 1 time in total.
Current Project--Writing Services [OPEN]
Image

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Save Slot Spacing Issues

#2 Post by namastaii »

And you've messed with the offset numbers?

User avatar
LiamExe
Regular
Posts: 35
Joined: Thu May 08, 2014 4:58 pm
Projects: Locked Souls
itch: liamexe
Contact:

Re: Save Slot Spacing Issues

#3 Post by LiamExe »

namastaii wrote:And you've messed with the offset numbers?
Yeah. They mess with all of the slots and move them as a whole, while keeping that same gap in the middle. It's been a bit of a head scratcher for me why that part in the middle seems to stick no matter what. The only thing I could think of is that the space in the middle is perhaps where the slot originally stretched out to until I shrunk it down with the x and y maximum/minimum commands, but then I wouldn't know why it keeps after.

And when I use 'Spacing' in the filepicker screen, it appears to manage the spacing vertically, but not horizontally.

I've tried deleting all sorts of persistent data and clearing out all the save slots too, just in case any of that was messing with values somewhere. Dx
Current Project--Writing Services [OPEN]
Image

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Save Slot Spacing Issues

#4 Post by namastaii »

Okay so the offset moves the boxes and such over either way. If there's that gap .. is it attached to the buttons? Are the buttons just super long right there? They obviously don't appear to be but the box housing the buttons feels it needs to be longer, I guess.

What about xminimum for the buttons?

User avatar
LiamExe
Regular
Posts: 35
Joined: Thu May 08, 2014 4:58 pm
Projects: Locked Souls
itch: liamexe
Contact:

Re: Save Slot Spacing Issues

#5 Post by LiamExe »

namastaii wrote:Okay so the offset moves the boxes and such over either way. If there's that gap .. is it attached to the buttons? Are the buttons just super long right there? They obviously don't appear to be but the box housing the buttons feels it needs to be longer, I guess.

What about xminimum for the buttons?
I don't believe it's attached to the buttons, as I mouse over the gap and click and it doesn't seem to highlight or do anything with either of the slots on each column. But yeah, that's what it looks like, the grid holding the columns seems to think it needs to be that length to contain everything. Is there maybe something I could put into the grid to dictate its size and forcefully shrink it down?

Ahh, I fixed it while in the middle of writing this response though! I hadn't thought to put the xminimum/maximum within the actual 'grid' part itself, and had just been putting it below it.

But I put it like this:

Code: Select all

grid columns rows xmaximum 850:
And that squashes things back together so it looks all nice now~

I appreciate all the help though, as it led me to go back and poke at things more and try random things to see what might solve it.
Attachments
Fixed
Fixed
Current Project--Writing Services [OPEN]
Image

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Save Slot Spacing Issues [SOLVED]

#6 Post by namastaii »

Great :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]