Hotspots active on two call screens!

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
Gexa
Newbie
Posts: 1
Joined: Fri Nov 09, 2018 11:39 am
Contact:

Hotspots active on two call screens!

#1 Post by Gexa »

Evening all,
As the title says I have an Issues with hotspots which are called as

Code: Select all

label main:
   scene #1
   call screen #1
   screen #1:
       imagemap:
           alpha False
           ground "#1"
           hover "#1_hover"

           hotspot (28, 809, 75, 72) action ToggleScreen("#2")
           hotspot (34, 32, 67, 96) action ToggleScreen("#3") 
           
label #2:
   call screen #2
   screen #2:
       imagemap:
           alpha False
           ground "#2"
           hover "#2_hover"

           hotspot (33, 809, 69, 71) action ToggleScreen("#2")
           hotspot (1531, 39, 36, 34) action ToggleScreen("#3")
           hotspot (1531, 39, 36, 34) action jump("#some image")
           
label #3:
   call screen #3
   screen #3:
       imagemap:
           alpha False
           ground "#3"
           hover "#3_hover"

           hotspot (33, 809, 69, 71) action ToggleScreen("#3")
           hotspot (1531, 39, 36, 34) action ToggleScreen("#2")
           hotspot (1531, 39, 36, 34) action jump("#some other image")
           
The problem is that the two windows are on top of each other so the hotspots are on the same location thus sometimes clicking on hotspot (33, 809, 69, 71) action ToggleScreen("#2") will not do anything, pressing the hotspot (1531, 39, 36, 34) action jump("#some image") will open the image from label #3 (#some other image). The question is how can I give priority in terms of hotspots to the most active screen?
Thank you all!

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Hotspots active on two call screens!

#2 Post by xavimat »

I think this code is confusing. Screens do not belong to labels, but they are defined on their own, and then can be called or shown from any label.
Also, how does ToggleScreen work with call screen? If ToggleScreen only changes visibility but there is no "Return()", is the screen there but hidden? Is it responsive?

I suggest you change your implementation. Write only one screen with screen variables that tell what parts of the screen should be shown and what parts shouldn't.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Hotspots active on two call screens!

#3 Post by isobellesophia »

You should probably read the documentation carefully.

https://www.renpy.org/doc/html/screen_a ... ggleScreen
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

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