textbutton xmaximum ignored

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

textbutton xmaximum ignored

#1 Post by jack_norton »

I'm doing a custom preferences modifying the existing one, I wanted to add a "difficulty setting" option. I have found a bug (I think). If I set the buttons xmaximum, I can change the width of buttons:

Code: Select all

    style.pref_vbox.xfill = True

    style.pref_button.size_group = "pref"
    style.pref_button.xalign = 1.0
    style.pref_button.xmaximum= 120
but if I try the same inside the button codes, it doesn't work (same button size):

Code: Select all

            frame:
                style_group "pref"
                has vbox
                label _("Game Difficulty")
                hbox:
                    for i in range(3):
                        textbutton ("{size=18}"+SDiff[i]+"{/size}") xmaximum 100 action SetDifficulty(i) 
xmaximum 100 is completely ignored. I don't understand then how I can change the xmaximum in preferences ? :(
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: textbutton xmaximum ignored

#2 Post by PyTom »

xmaximum only takes affect if the button wants to be bigger than that. You might also want to set an xminimum on the button.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users