Text not filling horizontal space in choice buttons...

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
crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Text not filling horizontal space in choice buttons...

#1 Post 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,
Attachments
Choices.png
alwaysthesamebluesky.com


crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

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

#3 Post by crimsonnight »

Cheers but I've already got that set to 0.0 in the screengrab
alwaysthesamebluesky.com

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

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

#4 Post 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.

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

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

#5 Post 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,
alwaysthesamebluesky.com

CupCakeComedy
Regular
Posts: 26
Joined: Sun Feb 22, 2015 7:46 pm
Contact:

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

#6 Post 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.

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

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

#7 Post 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 :)
alwaysthesamebluesky.com

Post Reply

Who is online

Users browsing this forum: Bing [Bot]