Main menu centered buttons

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
lFeedYoul
Newbie
Posts: 7
Joined: Sat Oct 06, 2018 3:47 am
Contact:

Main menu centered buttons

#1 Post by lFeedYoul » Sat Oct 06, 2018 3:50 am

Hello everybody! I need help. How to remove the main menu buttons when you click on them? I placed the buttons in the center, but when I clicked on them, naturally, the menu of this button pops up, but at the same time the buttons of the main menu are not hidden.

User avatar
Kia
Miko-Class Veteran
Posts: 658
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

Re: Main menu centered buttons

#2 Post by Kia » Sat Oct 06, 2018 2:09 pm

I think you've removed the "tag menu" line from your main menu

Code: Select all

screen main_menu():
    tag menu

lFeedYoul
Newbie
Posts: 7
Joined: Sat Oct 06, 2018 3:47 am
Contact:

Re: Main menu centered buttons

#3 Post by lFeedYoul » Sun Oct 07, 2018 12:50 am

Hmm... Everything is in place

Code: Select all

screen main_menu():

    
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    
    frame:
        pass

    
    use navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


User avatar
Kia
Miko-Class Veteran
Posts: 658
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

Re: Main menu centered buttons

#4 Post by Kia » Sun Oct 07, 2018 2:13 am

check your other screens for "tag menu"
the screens with the same tag replace each other and when you go to another screen with the same tag, the previous screen will be hidden, if they're not doing that the likely case is: one of them doesn't have the same tag

lFeedYoul
Newbie
Posts: 7
Joined: Sat Oct 06, 2018 3:47 am
Contact:

Re: Main menu centered buttons

#5 Post by lFeedYoul » Sun Oct 07, 2018 2:40 am

This is a new project with a standard code, only the position of the buttons in the main menu has been changed using

Code: Select all

screen navigation():
    tag menu

    vbox:
        style_prefix "navigation"

        xalign 0.5
        yalign 0.5

User avatar
Kia
Miko-Class Veteran
Posts: 658
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

Re: Main menu centered buttons

#6 Post by Kia » Sun Oct 07, 2018 4:35 am

I don't think navigation should have a "tag menu"
maybe you can explain the problem with some screenshots, I still think the problem is a missing or misplaced "tag menu" line somewhere

User avatar
IrinaLazareva
Veteran
Posts: 255
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy, Эра Тёмных Небес
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Main menu centered buttons

#7 Post by IrinaLazareva » Sun Oct 07, 2018 5:15 am

This normal behavior of the main_menu screen...
Screens of main and game menu are connected by a 'tag menu' and a 'use navigation' statement.
If you want to change it, you need rewrite navigation screen(), and remove a use statement those screens where buttons aren't required.

https://www.renpy.org/doc/html/screen_s ... nu-screens
https://www.renpy.org/doc/html/screens. ... -statement
https://www.renpy.org/doc/html/screens.html#use
There is a light at the end of the tunnel, just pray it's not a train.

lFeedYoul
Newbie
Posts: 7
Joined: Sat Oct 06, 2018 3:47 am
Contact:

Re: Main menu centered buttons

#8 Post by lFeedYoul » Sun Oct 07, 2018 5:43 am

Thank you so much! I created a second screen game_menu2 completely copying screen game_menu, only deleted use navigation. And in the screens where I needed to have no buttons, I just fixed the use game_menu instead on use game_menu2 and it all worked. Спасибо.

Post Reply

Who is online

Users browsing this forum: No registered users