[Solved] Gamemenu return button not working

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

[Solved] Gamemenu return button not working

#1 Post by chesarty »

I'm working on a custom main menu using imagebuttons and everything else is working as intended except for one thing. When I go from main menu to settings and then try to use the return button, it starts the game instead of going back to the main menu. This is odd since I didn't change anything about the game menu, only main menu.

Main menu code:

Code: Select all

screen main_menu():
    
    imagemap:
        ground "animated mainmenu"
        idle "gui/mainmenuidle.png"
        hover "gui/mainmenuhover.png"
        
        hotspot (0, 454, 525, 110) action Start():
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 575, 525, 110) action ShowMenu("load"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 691, 525, 110) action ShowMenu("preferences"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 815, 525, 110) action ShowMenu("help"):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        hotspot (0, 938, 525, 110) action Quit(confirm=not main_menu):
            hover_sound "audio/hoversound.mp3"
            activate_sound "audio/choicesound.mp3"
        
Game menu return label code:

Code: Select all

    textbutton _("Return"):
        style "return_button"

        action Return("main_menu")
        
Any help? :0
Last edited by chesarty on Sat Oct 17, 2020 7:12 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Gamemenu return button not working

#2 Post by Imperf3kt »

You need to add tag menu to the screen.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Gamemenu return button not working

#3 Post by chesarty »

Imperf3kt wrote: Thu Oct 15, 2020 5:02 pm You need to add tag menu to the screen.
Thanks. Added it, but it still doesn't go back to the main menu.

nananame
Regular
Posts: 72
Joined: Fri Oct 13, 2017 1:40 pm
Contact:

Re: Gamemenu return button not working

#4 Post by nananame »

The return code for the game menu should not pass anything:

Code: Select all

    textbutton _("Return"):
        style "return_button"

        action Return()##delete the "main_menu"

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]