How to add extra menu in hotspots?

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
Mooneon
Regular
Posts: 78
Joined: Sat Jul 04, 2015 4:05 pm
Contact:

How to add extra menu in hotspots?

#1 Post by Mooneon »

I don't know if this has been answered already but, I really want to put an extra menu in my main menu screen, using hotspots. So in my extra menu I want to add credits and maybe little bios of character. I don't exactly know how to create a code like so.

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: How to add extra menu in hotspots?

#2 Post by chocoberrie »

Hotspots are used in imagemaps. If you want to add another hotspot, all you need to do is add... well, another one, and add an action to it that shows the extra "menu." The action ShowMenu is used for game menus, but not regular screens. To show a regular screen, you need to use Show(screen name here). (See the Ren'Py documentation here about actions for screens.)

It would look like this:

Code: Select all

screen main_menu:
    tag menu
    imagemap:
        ground "FILE NAME HERE"
        idle "FILE NAME HERE"
        hover "FILE NAME HERE"
        
        alpha False
        # This is so that everything transparent is invisible to the cursor. 
       
        hotspot (#, #, #, #) action Start()
        hotspot (#, #, #, #) action ShowMenu("load")
        hotspot (#, #, #, #) action ShowMenu("preferences")
        hotspot (#, #, #, #) action Show(bonus)
        hotspot (#, #, #, #) action Help()
        hotspot (#, #, #, #) action Quit(confirm=False)
In the above code, action Show(bonus) is the action for the hotspot. Note that bonus is the label used for the Bonus screen, if I want one of those. You can use any label name you want, as long as it doesn't have spaces in it (e.g. chara_gallery, music_room, etc.).

In order for the Bonus screen to appear when the hotspot is clicked on, I would have to add it in screens.rpy and customize it. Like this:

Code: Select all

screen bonus:
    tag menu
    # customize the menu here

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: How to add extra menu in hotspots?

#3 Post by chocoberrie »

Also, this question should be posted in the Ren'Py Questions & Announcements forum, not in the Cookbook.

User avatar
Mooneon
Regular
Posts: 78
Joined: Sat Jul 04, 2015 4:05 pm
Contact:

Re: How to add extra menu in hotspots?

#4 Post by Mooneon »

OH MY GOD. I didn't realize it was.

Post Reply

Who is online

Users browsing this forum: No registered users