[SOLVED] main menu troubles

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
StormyThunder
Newbie
Posts: 10
Joined: Wed Aug 23, 2023 6:09 pm
Projects: Working solo on "Afterlife Feels" and its written novel.
itch: stormythunder
Discord: Huh#7134
Contact:

[SOLVED] main menu troubles

#1 Post by StormyThunder »

I have two questions:

#1: How can I make the images disappear when a different menu screen comes up? (ex: choosing the settings button and all images disappear until return is clicked)
Code (edited screens.rpy):

Code: Select all

screen navigation():

    fixed:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:
        
            imagebutton auto "gui/stormMMportrait_%s.png" action Start() activate_sound "startclick.wav" xpos 0.3 ypos 0.3

            imagebutton auto "gui/pwMMportrait_%s.png" action ShowMenu("bobcachievements") xpos 0.6 ypos 0.0
#2: I want to make a button that calls a screen to show all the other menu options since the image buttons make it crowded. How can I do that?
Last edited by StormyThunder on Mon Dec 11, 2023 4:43 pm, edited 1 time in total.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1026
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: main menu troubles

#2 Post by m_from_space »

StormyThunder wrote: Thu Dec 07, 2023 8:51 pm I have two questions:
#1: I don't know what you mean by "the images", but when you give a (main menu) screen the tag "menu", other screens with the same tag will hide.

Code: Select all

screen mymenu():
    tag menu
    # ...
#2: Isn't the main menu (screen) the screen that shows all the other menu options (like settings, help etc.)? What am I missing or what do you mean?

User avatar
StormyThunder
Newbie
Posts: 10
Joined: Wed Aug 23, 2023 6:09 pm
Projects: Working solo on "Afterlife Feels" and its written novel.
itch: stormythunder
Discord: Huh#7134
Contact:

Re: main menu troubles

#3 Post by StormyThunder »

m_from_space wrote: Fri Dec 08, 2023 6:34 am #1: I don't know what you mean by "the images", but when you give a (main menu) screen the tag "menu", other screens with the same tag will hide.

Code: Select all

screen mymenu():
    tag menu
    # ...
#2: Isn't the main menu (screen) the screen that shows all the other menu options (like settings, help etc.)? What am I missing or what do you mean?
1. The images are the image buttons.

2. Yes, I'm talking about the main menu screen. I'm trying to put a button to go to a different screen to show the other options, since the image buttons take up most of the regular main menu (start, settings and achievements are the image buttons). I would do it simply by putting another screen in the code or something if it didn't give me an error which is my main problem, really, because I know all that I have to do I just don't know how to execute it

User avatar
StormyThunder
Newbie
Posts: 10
Joined: Wed Aug 23, 2023 6:09 pm
Projects: Working solo on "Afterlife Feels" and its written novel.
itch: stormythunder
Discord: Huh#7134
Contact:

Re: main menu troubles

#4 Post by StormyThunder »

I've decided to do a less complicated idea, but I really do appreciate your response :)

How would I hide the image buttons after another screen shows up and make them reappear when I back out to the main menu again?

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1026
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: main menu troubles

#5 Post by m_from_space »

StormyThunder wrote: Fri Dec 08, 2023 4:51 pm I've decided to do a less complicated idea, but I really do appreciate your response :)

How would I hide the image buttons after another screen shows up and make them reappear when I back out to the main menu again?
You probably have to explain your new idea, otherwise I cannot follow what you want to achieve.

The current buttons are part of the screen "navigation" inside <screens.rpy>. They are included by both the "main_menu" screen and the "game_menu" screen. The latter is a kind of template for any menu screen that's not the main_menu (like preferences, help etc.)

If you don't want navigation buttons in a game_menu screen, or not in the main_menu, just remove the following line:

<screens.rpy>

Code: Select all

screen main_menu():
    tag menu
    # ...
    use navigation # <-- this incorporates the navigation button screen
    
screen game_menu(title, scroll=None):
    # ...
    use navigation # <-- this incorporates the navigation button screen

User avatar
StormyThunder
Newbie
Posts: 10
Joined: Wed Aug 23, 2023 6:09 pm
Projects: Working solo on "Afterlife Feels" and its written novel.
itch: stormythunder
Discord: Huh#7134
Contact:

Re: main menu troubles

#6 Post by StormyThunder »

I don't need help with my new idea, I'll just add smaller buttons to the title screen and figure it out like that, but thank you :)
Taking that line out worked, thank you very much :)

Post Reply

Who is online

Users browsing this forum: Lacha