This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


Changing the Main Menu after completing the game

This code allows players to unlock a different main menu based on what ending they last achieved.

screen main_menu:
    tag menu

    if persistent.ending == "Ending 1":
        use main_menu_1
    elif persistent.ending == "Ending 2":
        use main_menu_2
    else:
        use main_menu_default

Make sure to add the persistent code to the ending!

    "Do you love me?"
    menu:
        "Yes.":
            $ persistent.ending = "Ending 1"
            jump good_ending
        "No.": 
            $ persistent.ending = "Ending 2"
            jump bad_ending

The following is an example of the different main menus that can be unlocked. You're not limited to imagemaps, this code would work with textbuttons as well (such as adding a textbutton after the game is completed).

screen main_menu_default:
    tag menu

    imagemap:
        ground 'menu.png'
        hover 'menuhover.png'
       
        hotspot (522, 251, 722, 300) action Start()
        hotspot (522, 315, 722, 363) action ShowMenu('load')
        hotspot (522, 378, 722, 426) action ShowMenu('preferences')
        hotspot (522, 443, 722, 492) action Help()
        hotspot (522, 506, 722, 554) action Quit(confirm=False)   
        
screen main_menu_1:
    tag menu

    imagemap:
        ground 'menugood.png'
        hover 'menugoodhover.png'
       
        hotspot (522, 251, 722, 300) action Start()
        hotspot (522, 315, 722, 363) action ShowMenu('load')
        hotspot (522, 378, 722, 426) action ShowMenu('preferences')
        hotspot (522, 443, 722, 492) action Help()
        hotspot (522, 506, 722, 554) action Quit(confirm=False)   

        
screen main_menu_2:
    tag menu

    imagemap:
        ground 'menubad.png'
        hover 'menubadhover.png'
       
        hotspot (522, 251, 722, 300) action Start()
        hotspot (522, 315, 722, 363) action ShowMenu('load')
        hotspot (522, 378, 722, 426) action ShowMenu('preferences')
        hotspot (522, 443, 722, 492) action Help()
        hotspot (522, 506, 722, 554) action Quit(confirm=False)