Adding in game menu to imagemap screens - how to?

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
jwilliams77
Newbie
Posts: 21
Joined: Sun Apr 19, 2015 8:35 pm
Contact:

Adding in game menu to imagemap screens - how to?

#1 Post by jwilliams77 » Sat Jul 30, 2016 5:26 pm

I've been researching, to no avail, how to add my screen which I've created for the in game menu to the imagemap screens that I use for navigation & things.

So the imagemap is like this:

Code: Select all

screen citymap:
    imagemap:
       ground (image)
       hover (image)
       hotspot (coordinates)
What I tried was:

Code: Select all

screen citymap:
    use dateandtime
    imagemap:
       ground (image)
       hover (image)
       hotspot (coordinates)
where "dateandtime" is the name of in game screen which has things like day of the week, time, and various player stats:

Code: Select all

screen dateandtime:
    # all sorts of stats and buttons for the game.
How do I "nest," a screen inside another screen? Or how do I solve for this?

jwilliams77
Newbie
Posts: 21
Joined: Sun Apr 19, 2015 8:35 pm
Contact:

Re: Adding in game menu to imagemap screens - how to?

#2 Post by jwilliams77 » Sat Jul 30, 2016 6:49 pm

Copied / pasted from game in case it's easier to follow. This is the game menu I've created. It shows up on the Say screen; but, for imagemaps when the player is navigating, I'd also like it to show on that screen.

Code: Select all

screen dateandtime:
    add "images/combatring.png" xpos .02 ypos .02
    add "images/techring.png" xpos .08 ypos .02

    add "images/coinsicon.png" xpos .14 ypos .02
    vbox:
        xalign 0.045
        yalign 0.06
        text "[player.combat]" size 20

    vbox:
        xalign 0.105
        yalign 0.06
        text "[player.tech]" size 20

    vbox:
        xalign 0.17
        yalign 0.06

    vbox:
        xalign 0.025
        yalign 0.135
        text "Day [day], [gametime]:00" size 20

    vbox:
        xalign 0.025
        yalign 0.10
        text "HP:" size 20
    vbox:
        xalign 0.06 
        yalign 0.10
        bar range player.max_hp value player.hp xmaximum 140        


    vbox:
        xalign 0.17 
        yalign 0.06
        text "$[inventory.money]" size 20
So how to change this code (below) to include the menu from the above?

Code: Select all

screen citymapoverviewchoices:
    imagemap:
        ground "images/citymapoverviewbasicdaytime.png"
        hover "images/citymapoverviewbasicdaytimehover.png"
        hotspot (6, 87, 195, 45) clicked Return("beach")
        hotspot (770, 75, 195, 45) clicked Return("police")
        hotspot (750, 165, 190, 45) clicked Return("theater") 
        hotspot (330, 238, 200, 45) clicked Return("dealershipstreetview")
        hotspot (1060, 337, 210, 45) clicked Return("garden")
        hotspot (800, 378, 190, 45) clicked Return("workfromhome") 
        hotspot (185, 388, 200, 45) clicked Return("coffee")
        hotspot (700, 565, 195, 45) clicked Return("banksecondchance") 
        hotspot (12, 606, 200, 45) clicked Return("park") 

User avatar
gas
Miko-Class Veteran
Posts: 838
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Adding in game menu to imagemap screens - how to?

#3 Post by gas » Sat Jul 30, 2016 10:06 pm

Code: Select all

screen citymapoverviewchoices:
    imagemap:
        ground "images/citymapoverviewbasicdaytime.png"
        hover "images/citymapoverviewbasicdaytimehover.png"
        hotspot (6, 87, 195, 45) clicked Return("beach")
        hotspot (770, 75, 195, 45) clicked Return("police")
        hotspot (750, 165, 190, 45) clicked Return("theater") 
        hotspot (330, 238, 200, 45) clicked Return("dealershipstreetview")
        hotspot (1060, 337, 210, 45) clicked Return("garden")
        hotspot (800, 378, 190, 45) clicked Return("workfromhome") 
        hotspot (185, 388, 200, 45) clicked Return("coffee")
        hotspot (700, 565, 195, 45) clicked Return("banksecondchance") 
        hotspot (12, 606, 200, 45) clicked Return("park")
    use dateandtime()
yes, is that easy.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

jwilliams77
Newbie
Posts: 21
Joined: Sun Apr 19, 2015 8:35 pm
Contact:

Re: Adding in game menu to imagemap screens - how to?

#4 Post by jwilliams77 » Mon Aug 01, 2016 10:09 pm

Okay. Seems that the parentheses there were important (as well as order) somehow, I messed that up.

Copied your example. Poof - works perfect.

Thank you very, very much for the help.

Post Reply

Who is online

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