(SOLVED) Making Quick Menu Horizontal?

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
RoboKnight
Newbie
Posts: 19
Joined: Sun Feb 18, 2018 6:12 pm
Contact:

(SOLVED) Making Quick Menu Horizontal?

#1 Post by RoboKnight »

Hello,
This is my first post here. I've been avoiding asking for help by trying to plough through and google the answers to my questions, but I'm at the point where I can't find answers related to what I want done anymore. Truly a pity.

I've no clue on how to make my quick menu vertical instead of horizontal (EDIT: typo). I came close by using the answer someone gave this guy:
viewtopic.php?t=18146

I'm trying to get four buttons in the lower right hand corner of the GUI: BACK, AUTO, SAVE, LOAD (in this order)
but I've now got a weird bug where my "SAVE" and "OPTIONS" buttons appear where I want them to, but then they're placed right on top of each other now in the upper leftmost corner. Also, I can't seem to get the "BACK" and "AUTO" buttons on because the game won't load and instead gives me an error message because apparently my syntax is wrong for the line where have:

ui.textbutton("BACK", clicked=ccinc("_game_menu_rollback") xminimum=100)
ui.textbutton("AUTO", clicked=ccinc("_game_menu_auto") xminimum=100)


This is the code I currently have (I've commented out code that I don't think is necessary, but I may want to keep if I try other things, so ignore those):

Code: Select all

screen quick_menu():

    ## Ensure this appears on top of other screens.
    #zorder 100

    #if quick_menu:

        #hbox:
            style_group"quick"

            xalign 1.0
            yalign 1.0

            textbutton _("BACK") action Rollback()
            textbutton _("AUTO") action Preference("auto-forward", "toggle")
            textbutton _("SAVE") action ShowMenu('save')
            textbutton _("OPTIONS") action ShowMenu('preferences')



init -1 python:
    style.quick_button.set_parent('default')
    style.quick_button.background = None
    style.quick_button.xpadding = 5

    style.quick_button_text.set_parent('default')
    style.quick_button_text.size = 35
    style.quick_button_text.idle_color = "#000000"
    style.quick_button_text.hover_color = "#ccc"
    style.quick_button_text.selected_idle_color = "#cc08"
    style.quick_button_text.selected_hover_color = "#cc0"
    style.quick_button_text.insensitive_color = "#4448"

    
    # Make all the main menu buttons be the same size.
    style.quick_button.size_group = "mm"
    style.quick_button_text.size = 35

    
    # Set a default value for the auto-forward time, and note that AFM is
    # turned off by default.
    config.default_afm_time = 10
    config.default_afm_enable = False

init python:

    def toggle_skipping():
        config.skipping = not config.skipping

    show_button_game_menu = True

    def button_game_menu():
        
        if show_button_game_menu:

            # to save typing
            ccinc = renpy.curried_call_in_new_context

            ui.vbox(xpos=0.99, ypos=0.99, xanchor='right', yanchor='bottom')
            ui.textbutton("BACK", clicked=ccinc("_game_menu_rollback") xminimum=100)
            ui.textbutton("AUTO", clicked=ccinc("_game_menu_auto") xminimum=100)
            ui.textbutton("SAVE", clicked=ccinc("_game_menu_save"), xminimum=100)
            ui.textbutton("OPTIONS", clicked=ccinc("_game_menu_preferences"), xminimum=100)
            ui.close()


    config.window_overlay_functions.append(button_game_menu)
Thank you for your time.
Last edited by RoboKnight on Sun Feb 18, 2018 8:40 pm, edited 2 times in total.

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Making Quick Menu Horizontal?

#2 Post by irredeemable »

Just going on your description and not your code (also assuming you mean vertical as the quick menu is horizontal by default), you should be able to accomplish what you want by simply changing the quick menu screen to something like this:

Code: Select all

screen quick_menu():

    zorder 100

    if quick_menu:

        vbox:
            style_prefix "quick"

            xalign 1.0
            yalign 1.0

            textbutton _("Back") action Rollback()
            textbutton _("Auto") action Preference("auto-forward", "toggle")
            textbutton _("Save") action ShowMenu('save')
            textbutton _("Load") action ShowMenu('load')
            null height 10

RoboKnight
Newbie
Posts: 19
Joined: Sun Feb 18, 2018 6:12 pm
Contact:

Re: Making Quick Menu Horizontal?

#3 Post by RoboKnight »

Well that works. Thank you!!
By the way, what does "null height 10" do and how do I go about making the Quick Menu larger?

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Making Quick Menu Horizontal?

#4 Post by irredeemable »

null height 10 is just to give a buffer between the last textbutton in the vbox and the bottom of the screen. You could probably do the same thing by setting the padding or margin properties of the vbox but I'm just used to doing it that way. To make it larger you'd have to either change the quick_ styling or individually change the styling of the components (e.g. if you added 'text_size 30' to each of the text buttons you'd get a much larger menu).

RoboKnight
Newbie
Posts: 19
Joined: Sun Feb 18, 2018 6:12 pm
Contact:

Re: Making Quick Menu Horizontal?

#5 Post by RoboKnight »

Thank you for your help! I really appreciate it!

Post Reply

Who is online

Users browsing this forum: Google [Bot]