On press hotspot opens PopUp

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
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

On press hotspot opens PopUp

#1 Post by richycapy » Sun Jun 02, 2019 5:16 pm

Greetins!

I made this little screen

Code: Select all

screen comingsoon:
    modal True
    zorder 100

    fixed:
        area 500, 500, 620, 200
        add "images/gui/notify-comingsoon.png"
        hbox:
                yalign 0.10
                xalign 0.03
                text _('Still under development')

    timer 3.25 action Hide('comingsoon')

screen bg_casa_andy_room:
    imagemap:
        ground "images/bgs/casa/andy-room.png"
        hover "images/bgs/casa/andy-room-hover.png"
        hotspot(811, 336, 269, 281) action Return("casa_cama_andy")
        hotspot(1163, 122, 114, 596) action Return("casa_hallway")
        
label label_casa_andy_room:
    hide bg_casa_hallway
    call screen bg_casa_andy_room
    if _return == "casa_cama_andy":
        hide bg_casa_andy_room
        jump label_casa_frente
    elif  _return == "casa_hallway":
        show screen comingsoon
        
label label_casa_bathroom:
    hide bg_casa_hallway
    call screen bg_casa_bathroom
    if _return == "casa_livingroom":
        hide bg_casa_hallway
        jump label_casa_hallway        
So it should show the pop up when I press the hotspot casa_hallway. The problem is that it shows the popup, but it also continues the script, meening it goes to the next "jump" in the code, in this case call screen bg_casa_bathroom is there a way to just show the pop up with out continuing the script?

Thanks!
Last edited by richycapy on Sun Jun 02, 2019 6:01 pm, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: On press hotspot opens PopUp

#2 Post by Imperf3kt » Sun Jun 02, 2019 5:41 pm

Add modal True to the screen bg_casa_andy_room
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: On press hotspot opens PopUp

#3 Post by richycapy » Sun Jun 02, 2019 5:58 pm

Nop, didnt work either :(

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: On press hotspot opens PopUp

#4 Post by Matalla » Mon Jun 03, 2019 4:42 am

You can do several things, probably a combination of them

- Call the screen comingsoon, instead of showing it
- Put a pause and/or a jump to where it should go after showing the screen
- Put some order in your code, like, taking your screens to another file
Comunidad Ren'Py en español (Discord)
Honest Critique

strayerror
Regular
Posts: 154
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: On press hotspot opens PopUp

#5 Post by strayerror » Mon Jun 03, 2019 5:01 pm

Need take both responses so far and glue them together!
Matalla wrote:
Mon Jun 03, 2019 4:42 am
- Put a pause and/or a jump to where it should go after showing the screen
Using a jump after showing the popup will ensure that you stay in the same room, instead of accidentally ending up in the bathroom code:

Code: Select all

    elif  _return == "casa_hallway":
        show screen comingsoon
        jump label_casa_andy_room # <--- restart the room
    return # <-- safety to prevent accidentally continuing to the bathroom in future
Imperf3kt wrote:
Sun Jun 02, 2019 5:41 pm
Add modal True to the screen bg_casa_andy_room
After the jump change, the popup will display on top of the bg_casa_andy_room, which is hopefully what you're going for. Adding the modal setting Imperf3kt metions will ensure that you can't click any of the hotspots again until after the popup has hidden itself.

Hope that helps!

User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: On press hotspot opens PopUp

#6 Post by richycapy » Mon Jun 03, 2019 6:01 pm

It helped! :D Thanks a lot! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot]