Page 1 of 1

Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 3:28 pm
by crimsonnight
I've tried various formatting commands but can't find a fix (see attached.) Does anyone have any idea what I need to do? Cheers,

Re: Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 5:46 pm
by philat

Re: Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 7:40 pm
by crimsonnight
Cheers but I've already got that set to 0.0 in the screengrab

Re: Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 7:47 pm
by philat
...which would make the text left-aligned. You want 0.5 for centered text.

Although I just realized that you could be asking why your text is wrapping lines. That, you'd have to show your code to tell. Probably some weirdness around the size of the container.

Re: Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 8:27 pm
by crimsonnight
Yep, I want it to be left-aligned, just for the lines to reach the end of the box! Here's my code:

Code: Select all

screen choice:

    window: 
        style "menu_window"        
        xalign 0.2
        yalign 0.5
        
        vbox:
            style "menu"
            spacing 2
            
            for caption, action, chosen in items:
                
                if action:  
                    
                    button:
                        action action
                        style "menu_choice_button"                        

                        text caption style "menu_choice"
                    
                else:
                    text caption style "menu_caption"

init -2 python:
    config.narrator_menu = True
    
    style.menu_window.set_parent(style.default)
    style.menu_choice.set_parent(style.button_text)
    style.menu_choice.clear()
    style.menu_choice_button.set_parent(style.button)
    style.menu_choice_button.xminimum = int(config.screen_width * 2.0)
    style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
    
    style.menu_choice.size = 35
    style.menu_choice.color = "#ffffffCC"
    style.menu_choice.hover_color = "#ffffff"
    style.menu_choice.xalign = 0.0
    style.menu_choice.xmaximum = 5000
    
    style.menu_choice_button.background = "#7e947080"
    style.menu_choice_button.hover_background = "#7e9470CC"
    style.menu_choice_button.ymargin = 20
Cheers,

Re: Text not filling horizontal space in choice buttons...

Posted: Tue Feb 24, 2015 10:48 pm
by CupCakeComedy
XD XD XD
Its fun. I didn't noticed at first.
style.menu_choice_button.xminimum = int(config.screen_width * 2.0)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)

The minimum is larger than the maximum. Try fix it.

Re: Text not filling horizontal space in choice buttons...

Posted: Wed Feb 25, 2015 5:32 am
by crimsonnight
CupCakeComedy wrote:XD XD XD
Its fun. I didn't noticed at first.
style.menu_choice_button.xminimum = int(config.screen_width * 2.0)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)

The minimum is larger than the maximum. Try fix it.
All working perfectly now, thank you. Sometimes you just need a second pair of eyes :)