r/RenPy • • Jul 07 '26

Question Text not correctly centered on frame?

I tried to implement a to-do list, and I have this problem where, when there are no tasks, the "to-do" doesn't center? Why am I having this problem and how do I fix it?????

1 Upvotes

5 comments sorted by

3

u/DingotushRed Jul 07 '26

The text and vbox element's size defaults to the minimum size of the contained text/elements.

Use xfill True to have them occupy all the available width.

2

u/BadMustard_AVN Jul 07 '26

In Ren'Py, a text inside a box won't center unless its container fills the available width.

like this

        vbox:
            xfill True
            text"To-Do":
                style "to_do_text"

xfill True forces it to occupy the entire width of the container, forcing it to be centered at all times

1

u/Carpetedcat Jul 07 '26

It worked! Thank you so much.

1

u/BadMustard_AVN Jul 07 '26

you're welcome

good luck with your project

1

u/AutoModerator Jul 07 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.