Replacing the main menu overlay with an image map (solved)

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
Tookipalooki
Newbie
Posts: 11
Joined: Tue Jan 03, 2017 9:38 pm
Completed: Chook & Sosig
Projects: Chook & Sosig : A Case of Murder
Tumblr: Tookipalooki
itch: TookiPalooki
Contact:

Replacing the main menu overlay with an image map (solved)

#1 Post by Tookipalooki »

Edit: I chipped away at it and suddenly a light came on and I figured it out :}

Hello sorry for another question so soon, I feel like I'm so close to cracking this but its just out of reach
I'm wanting to replace the overlay image on the main menu with an image map. which I've got, but I'm wanting it to go away in the load,preference and about screens and go go to the usual text that comes as default.

This is what I currently have for navigation code:

Code: Select all

screen navigation():

        imagemap:
            ground 'gui/overlay/main_menu.png'
            hover 'gui/overlay/main_menu_hover.png'
        
            hotspot (69,44,486,227) action Start()
            hotspot (103,241,472,342) action ShowMenu('load')
            hotspot (96,437,486,546) action ShowMenu('preferences')
            hotspot (109,656,479,771) action ShowMenu('about')
            hotspot (113,868,522,1031) action Quit(confirm=False)

and images to illustrate how it currently runs:
Image
Image

any help would be massively appreciated, I'm having great fun learning this.

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Replacing the main menu overlay with an image map (solve

#2 Post by Divona »

"screen navigation" is a share code among "main_menu" and "game_menu". To have your image map appears only in main menu, do create another screen to do just that, and include it in "main_menu"

Code: Select all

screen main_menu_navigation():

    imagemap:
        ground 'gui/overlay/main_menu.png'
        hover 'gui/overlay/main_menu_hover.png'
        
        hotspot (69,44,486,227) action Start()
        hotspot (103,241,472,342) action ShowMenu('load')
        hotspot (96,437,486,546) action ShowMenu('preferences')
        hotspot (109,656,479,771) action ShowMenu('about')
        hotspot (113,868,522,1031) action Quit(confirm=False)

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    ##
    ## We will replace this with our own main menu navigation.

    # use navigation
    use main_menu_navigation

    ## The rest of main menu screen
    . . .
Completed:
Image

User avatar
Tookipalooki
Newbie
Posts: 11
Joined: Tue Jan 03, 2017 9:38 pm
Completed: Chook & Sosig
Projects: Chook & Sosig : A Case of Murder
Tumblr: Tookipalooki
itch: TookiPalooki
Contact:

Re: Replacing the main menu overlay with an image map (solve

#3 Post by Tookipalooki »

thankyou you are super!

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: Replacing the main menu overlay with an image map (solved)

#4 Post by oatnoodles »

Hi, I'm trying to do this with my main menu - but I get errors. How much of the existing/default code do I need to remove/replace to get the imagemap?
Ren'py amateur looking to learn as much as possible! Please be patient with me.

Post Reply

Who is online

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