Is there a way to move back and forth between imagemaps?

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
polisummer
Newbie
Posts: 12
Joined: Sat Jul 29, 2017 12:37 pm
Projects: Absolutely Haunting, What?! My Neighbors are Demons?!!
Organization: Kyungeki Workshop
Tumblr: polisummer
itch: polisummer
Location: middle of a tree sanctuary
Contact:

Is there a way to move back and forth between imagemaps?

#1 Post by polisummer »

I need some help jumping between call screens. Basically each screen is an imagemap that has hotspot buttons on it. When you click a hotspot it will do `Show("other_screen")` and call a different screen, with a different image map. The issue is that on subsequent imagemaps, if I press a hotspot button that should call the previous screen, nothing happens. The other imagemap doesn't get drawn and the current imagemap remains. Is this something to do with `call`? Is there a way to return from a current call to a previous one?

An exmaple of my code is below:

Code: Select all

label hill_dialogue:
  scene hill
  # dialogue
  e "dialogue test"
  "end of dialogue"
  call screen Town


screen Hill():
    imagemap:
        ground "hill.png"
        hover "hill_hover.png"
        hotspot(520, 264, 664-520, 652-264) action Jump("hill_dialogue")  # begin hill dialogue
        hotspot(914, 842, 1610-914, 1080-838) action Show("Town")         # path to town

screen Town():
    imagemap:
        ground "Town.png"
        hover "town_hover.png"
        hotspot(115, 451, 380-115, 724-451) action Show("Hill")   # path to hill
        hotspot(568, 502, 912-568, 700-502) action Show("Pub")    # door to pub
So after the dialogue I am sent to the Town, where I can click on a button that should send me back to the hill. However, nothing happens when I click on that button.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Is there a way to move back and forth between imagemaps?

#2 Post by Remix »

action [ Show('other_screen'), Hide('self_screen') ]

Basically you are showing screens one on top of the other, then trying to show the other which already exists underneath and stays there hidden...
Frameworks & Scriptlets:

polisummer
Newbie
Posts: 12
Joined: Sat Jul 29, 2017 12:37 pm
Projects: Absolutely Haunting, What?! My Neighbors are Demons?!!
Organization: Kyungeki Workshop
Tumblr: polisummer
itch: polisummer
Location: middle of a tree sanctuary
Contact:

Re: Is there a way to move back and forth between imagemaps?

#3 Post by polisummer »

Remix wrote: Thu Sep 14, 2017 9:47 am action [ Show('other_screen'), Hide('self_screen') ]

Basically you are showing screens one on top of the other, then trying to show the other which already exists underneath and stays there hidden...
That solved it, thanks!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]