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

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
roankun
Regular
Posts: 94
Joined: Fri Jun 11, 2010 4:01 am
Projects: RHS
Contact:

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

#1 Post 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?
Attachments
quickmenu.jpg
quickmenu.jpg (6.33 KiB) Viewed 1036 times
Last edited by roankun on Sat Mar 03, 2012 11:09 pm, edited 1 time in total.
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Customizing Quick Menu (Textalign not working?)

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

roankun
Regular
Posts: 94
Joined: Fri Jun 11, 2010 4:01 am
Projects: RHS
Contact:

Re: Customizing Quick Menu (Textalign not working?)

#3 Post 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
Attachments
with style.quick_button.background = "#fff"
with style.quick_button.background = "#fff"
Untitled2.jpg (6.81 KiB) Viewed 993 times
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/

Post Reply

Who is online

Users browsing this forum: No registered users