How to center date/time in the save slots?

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
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

How to center date/time in the save slots?

#1 Post by AERenoir »

So, I had mad my save load screen with the old code, and I wanted to change the layout a bit.
I don't want the numbers in front of the Day and Empty, I also want to have the text centered instead of left-aligned.
I've gone through the documentation but I'm still kind of confused.

The code I used

Code: Select all

screen load_save_slot:
    $ file_text = "%2s. %s\n  %s" % (
                        FileSlotName(number, 4),
                        FileTime(number, format="%A \n%d %B \n%Y \n(%I:%M%p)", empty=_("Empty")),
                        FileSaveName(number))
    

    add FileScreenshot(number) xpos 27 ypos 40
    text file_text xpos 35 ypos 140 size 18 color "000000"
I don't even know what this stands for:

Code: Select all

"%2s. %s\n  %s"
I tried erasing "FileSlotName", but it just made the project crash.

What I currently have:

Image

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: How to center date/time in the save slots?

#2 Post by hell_oh_world »

You can try the the xalign or text_align property of text.
https://www.renpy.org/doc/html/style_pr ... text_align

Code: Select all

text file_text xalign 0.5 text_align 0.5
I think xalign would ruin it, but you can try each one first to see which really works.
Your code looks a bit different though, I'm wondering if this from an old version of Ren'Py.

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

Re: How to center date/time in the save slots?

#3 Post by Imperf3kt »

From what I remember, the save slot buttons have the text as part of the button, so to edit its alignment you need to go to gui.rpy and edit the style "slot_button_text"
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: How to center date/time in the save slots?

#4 Post by AERenoir »

@hell_oh_world: Yeah, I had used the old code because I wanted an imagemapped screen and I wasn't entirely sure how to do this layout with the new one.
If there's a better way to put this together with the new code, I'm all ears! The new GUI format is rather confusing when I want to overhaul most of the built-in layouts with imagemaps and imagebuttons.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: How to center date/time in the save slots?

#5 Post by hell_oh_world »

Hmm... If it helps, there's actually a guide for the new gui https://www.renpy.org/doc/html/gui.html ... tion-guide.
I think that you can easily transfer this as the new version of Ren'Py (7.3.5) makes it easier to customize the save screen, you can do all the editing stuff in the file_slots screen in screens.rpy.
Can't really say though the process of moving this to the new gui as there's only a little bit of information that we know about your current screen setup.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: How to center date/time in the save slots?

#6 Post by AERenoir »

OK, I think I sort of get it. I'll try looking more closely at the setup and the doc. The grids, hbox and vbox has always been rather daunting to me.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]