Page 1 of 1

Customizing Quick Menu Textalign not working? [half-solved]

Posted: Sun Feb 26, 2012 11:16 am
by roankun
So the quick menu buttons won't... right-align. I've tried the following codes in screens.rpy. None of them work. Attached is the resulting image.

Code: Select all

    style.quick_button_text.text_align = 1.0

Code: Select all

    style.quick_button_text.xalign = 1.0

Code: Select all

    style.quick_button_text.xanchor = 1.0
    style.quick_button_text.xpos = 1.0
However, when I set text_align to pixels, say around 100, the word Auto moves.. or rather, it disappears off screen. It's a reaction, at least, but that's the only thing that moves. When I use decimals, nothing happens. Help?

Re: Customizing Quick Menu (Textalign not working?)

Posted: Mon Feb 27, 2012 2:22 am
by PyTom
Can you post the rest of the quick menu screen, including backgrounds, margins, boxes, and so on? It's hard to tell what's going in here.

You may also want to set style.quick_button.background = "#fff", just to see where the text is relative to the containing button.

Re: Customizing Quick Menu (Textalign not working?)

Posted: Mon Feb 27, 2012 5:16 pm
by roankun
Gotcha. ^^

I haven't actually changed much, except, well... Anyway, here's the quick menu from screens.rpy

Code: Select all

screen quick_menu:

    # Add an in-game quick menu.
    vbox:
        style_group "quick"
    
        xalign 1.0
        yalign 0.97

        textbutton _("Q.Save") action QuickSave()
        textbutton _("Q.Load") action QuickLoad()
        textbutton _("Skip") action Skip()
        textbutton _("Auto") action Preference("auto-forward", "toggle")
        
init -2 python:
    style.quick_button.set_parent('default')
    style.quick_button.background = "Screens/button3.png"
    style.quick_button.xminimum = 70
    
    
    style.quick_button_text.set_parent('default')
    style.quick_button_text.size = 15
    style.quick_button_text.text_align = 0.5
To be honest, I feel like the problem lies elsewhere... I saw this thread before and I was having a similar problem. I wasn't sure what "putting the code for the who window after the code for the what window" meant, so this is what I did. It wrecked the coordinates I previously set for xpos and ypos of the dialogbox and namebox, and if I remove the show_two_window from the character definition, the dialogbox and namebox both jump up more than halfway up the screen.

under screen say in screens.rpy after the if not two_window block.

Code: Select all

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

            if who:            
                window:
                    style "say_who_window"

                    text who:
                        id "who"
EDIT: Okay, so I kinda solved it by setting style.quick_button.leftpadding = 10