More Menu Customizing Problems...[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
User avatar
Hime_Takamura
Newbie
Posts: 10
Joined: Thu Oct 11, 2012 7:47 pm
Contact:

More Menu Customizing Problems...[SOLVED]

#1 Post by Hime_Takamura »

Okay, so I came here earlier looking for help with making my main menu bigger.

I did get that sorted out, but I'm having trouble with the Preference menu. It's still tiny, as seen here.

How do I make it bigger (and still keep it in the corner)?
Here's my code for the main menu and navigation menu:

Code: Select all

##############################################################################
# Main Menu 
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu:

    # This ensures that any other menu screen is replaced.
    tag menu

    # The background of the main menu.
    window:
        style "mm_root"

    # The main menu buttons.
    frame:
        style_group "mm"
        xalign .98
        yalign .98

        has vbox

        textbutton _("New Game") action Start()
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit(confirm=False)

init -2 python:


    # Make all the main menu buttons be the same size.
    style.mm_button.size_group = "mm"
    style.mm_button_text.size = 60


##############################################################################
# Navigation
#
# Screen that's included in other screens to display the game menu
# navigation and background.
# http://www.renpy.org/doc/html/screen_special.html#navigation
screen navigation:

    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox

        textbutton _("Return") action Return()
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Save Game") action ShowMenu("save")
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Main Menu") action MainMenu()
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit()

init -2 python:
    
    # Make all the main menu buttons be the same size.
    style.gm_root_text.size = 60
    style.gm_root.size_group = "gm_root"
    style.gm_nav_button.size_group = "gm_nav"
    style.gm_nav_button_text.size = 60
Second problem: quick menu.

I have a pre-made menu from here.

Here it is next to the default quick menu (text is black, so it's hard to see):
Image


How do I replace the default menu with the new menu, but also have the new menu going horizontally instead of vertically like it is?

Code: Select all

##############################################################################
# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu:

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

        textbutton _("Q.Save") action QuickSave()
        textbutton _("Q.Load") action QuickLoad()
        textbutton _("Save") action ShowMenu('save')
        textbutton _("Skip") action Skip()
        textbutton _("Auto") action Preference("auto-forward", "toggle")
        textbutton _("Prefs") action ShowMenu('preferences')
        
init -2 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("Skip", clicked=toggle_skipping, xminimum=100)
            ui.textbutton("Save", clicked=ccinc("_game_menu_save"), xminimum=100)
            ui.textbutton("Load", clicked=ccinc("_game_menu_load"), xminimum=100)
            ui.textbutton("Prefs", clicked=ccinc("_game_menu_preferences"), xminimum=100)
            ui.close()


    config.window_overlay_functions.append(button_game_menu)
        
Attachments
itty bitty menu
itty bitty menu
Last edited by Hime_Takamura on Sun Nov 18, 2012 11:38 am, edited 1 time in total.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: More Menu Customizing Problems...

#2 Post by Levrex »

Hime_Takamura wrote:Okay, so I came here earlier looking for help with making my main menu bigger.

I did get that sorted out, but I'm having trouble with the Preference menu. It's still tiny, as seen here.

How do I make it bigger (and still keep it in the corner)?

Code: Select all

##############################################################################
init -2 python:
    
    # Make all the main menu buttons be the same size.
    style.gm_root_text.size = 60
    style.gm_root.size_group = "gm_root"
    style.gm_nav_button.size_group = "gm_nav"
    style.gm_nav_button_text.size = 60
*Sighs*.
http://lemmasoft.renai.us/forums/viewto ... 13#p231407
If you do not understand, change "init -2 python" to "init -1 python".
How do I replace the default menu with the new menu, but also have the new menu going horizontally instead of vertically like it is?
I don't see any valid reason you'd have to do it by function instead of simply replacing the contents of quick menu. Yes, it's doable in screen language.
The answer to your question is - change the "v" letter in "vbox" to "h", as in "hbox". And then RTM about them.
And, finally, delete all lines that say "use quick_menu" in screens.rpy file if you wish to leave it as a function.
That'll get rid of default quick menu.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
Hime_Takamura
Newbie
Posts: 10
Joined: Thu Oct 11, 2012 7:47 pm
Contact:

Re: More Menu Customizing Problems...

#3 Post by Hime_Takamura »

Thank you very much, that worked perfectly. I could have gone without the belittling tone, but beggars can't be choosers.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], Milkymalk, Semrush [Bot]