Screen Conflicts

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
BM90
Newbie
Posts: 15
Joined: Sat Mar 31, 2018 2:48 am
Contact:

Screen Conflicts

#1 Post by BM90 »

I'm having a problem reconciling two separate screens. The game I'm working on uses screens with image buttons to navigate around, e.g. you click on the door and the image button sends you to a different room. No problems there. Now I'm working on an inventory screen that's accessed via a ui element. Once again, no problems. The inventory screen itself only covers up the center portion of the screen, leaving a transparent border so you can see where you are in the background. This isn't essential, but I prefer it stylistically. I initially had issues because even when the inventory screen was brought up, the navigation image buttons were still clickable in the background, allowing you to move around with the inventory screen still open. To try to solve this, I added hotspots to cover the transparent border and set them all to close the inventory screen when clicked. This kind of worked. Now you can no longer click the navigation image buttons that would show in the border. However if any of the navigation buttons are under the visible portion of the inventory screen, they're still clickable. Right now the only solution I can think of is to add an if statement to all the navigation buttons to disable them if the current screen is the inventory screen, but I'm wondering if there's a simpler way to handle this.

If that's all a little too long winded, basically I'm asking how to disable image buttons from one screen when another screen is brought up in front of it.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2397
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Screen Conflicts

#2 Post by Ocelot »

1) Change z-order, so your inventory screen would be higher than navigation. zorder 1
2) Make it modal: no other screens can interacted with if modal is present. modal True
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot]