Page 1 of 1

Buttons on top [FIXED]

Posted: Fri Mar 20, 2020 11:07 pm
by leviathanimation
I changed the navigation screen section to have custom buttons in the main menu. The problem is now when I click on the load button in the main menu, the load screen appears but all the buttons of the main menu are on top of it. Help how do i fix that?

Re: Buttons on top

Posted: Sat Mar 21, 2020 6:48 am
by Per K Grok
leviathanimation wrote: Fri Mar 20, 2020 11:07 pm I changed the navigation screen section to have custom buttons in the main menu. The problem is now when I click on the load button in the main menu, the load screen appears but all the buttons of the main menu are on top of it. Help how do i fix that?
Screen navigation is use by both the Main Menu and the other Game Menu screens, which I assume you already know.

In my experience when you try to customize stuff in the navigation screen just for the main menu, things tend to spill over to the other Game Menu screens for reasons that are not apparent.

The simplest way to handle this, in my opinion, is to make a special navigation screen just for the Main Menu.

Re: Buttons on top

Posted: Sat Mar 21, 2020 11:04 am
by leviathanimation
I'm still new to coding, so I feel like if I try to create a new navigation screen, things will be worst :( Is there really not a way to just play with the layers of the imagebutton? Like put it at bottom layer or something like that..?
Per K Grok wrote: Sat Mar 21, 2020 6:48 am
leviathanimation wrote: Fri Mar 20, 2020 11:07 pm I changed the navigation screen section to have custom buttons in the main menu. The problem is now when I click on the load button in the main menu, the load screen appears but all the buttons of the main menu are on top of it. Help how do i fix that?
Screen navigation is use by both the Main Menu and the other Game Menu screens, which I assume you already know.

In my experience when you try to customize stuff in the navigation screen just for the main menu, things tend to spill over to the other Game Menu screens for reasons that are not apparent.

The simplest way to handle this, in my opinion, is to make a special navigation screen just for the Main Menu.

Re: Buttons on top

Posted: Sat Mar 21, 2020 11:25 am
by gas
Apply these changes. In such way you have a navigation for main menu and one for other screens.

NAVIGATION:

Code: Select all

## Navigation screen ###########################################################
screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing


        textbutton _("History") action ShowMenu("history")

        textbutton _("Save") action ShowMenu("save")

        textbutton _("Load") action ShowMenu("load")

        textbutton _("Preferences") action ShowMenu("preferences")

        if _in_replay:

            textbutton _("End Replay") action EndReplay(confirm=True)

        elif not main_menu:

            textbutton _("Main Menu") action MainMenu()

        textbutton _("About") action ShowMenu("about")

        if renpy.variant("pc"):

            ## Help isn't necessary or relevant to mobile devices.
            textbutton _("Help") action ShowMenu("help")

            ## The quit button is banned on iOS and unnecessary on Android.
            textbutton _("Quit") action Quit(confirm=not main_menu)
Now, in your main menu, delete the 'use navigation' line and insert your buttons. Here I used text buttons, you can do whatever.

Code: Select all

screen main_menu():

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

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    vbox:
        style_prefix "navigation"
        textbutton "START" action Start()
        textbutton "LOAD" action ShowMenu("load")
        textbutton "PREFS" action ShowMenu("preferences")
        textbutton "QUIT" action Quit(confirm = False)

Re: Buttons on top

Posted: Sat Mar 21, 2020 12:47 pm
by leviathanimation
OMG Thank you so much!
gas wrote: Sat Mar 21, 2020 11:25 am Apply these changes. In such way you have a navigation for main menu and one for other screens.

NAVIGATION:

Code: Select all

## Navigation screen ###########################################################
screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing


        textbutton _("History") action ShowMenu("history")

        textbutton _("Save") action ShowMenu("save")

        textbutton _("Load") action ShowMenu("load")

        textbutton _("Preferences") action ShowMenu("preferences")

        if _in_replay:

            textbutton _("End Replay") action EndReplay(confirm=True)

        elif not main_menu:

            textbutton _("Main Menu") action MainMenu()

        textbutton _("About") action ShowMenu("about")

        if renpy.variant("pc"):

            ## Help isn't necessary or relevant to mobile devices.
            textbutton _("Help") action ShowMenu("help")

            ## The quit button is banned on iOS and unnecessary on Android.
            textbutton _("Quit") action Quit(confirm=not main_menu)
Now, in your main menu, delete the 'use navigation' line and insert your buttons. Here I used text buttons, you can do whatever.

Code: Select all

screen main_menu():

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

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    vbox:
        style_prefix "navigation"
        textbutton "START" action Start()
        textbutton "LOAD" action ShowMenu("load")
        textbutton "PREFS" action ShowMenu("preferences")
        textbutton "QUIT" action Quit(confirm = False)