Screen Layering Issues [Solved-ish]

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
Thee Forsaken One
Regular
Posts: 196
Joined: Sun Mar 01, 2009 8:10 pm
Completed: RE: Alistair++; Backstage Pass; Three Guys That Paint; The Reject Demon Toko - Ch 0; The Menagerie
Projects: Winning Hearts; Astral Hours
Organization: Forsaken Productions
Tumblr: ForsakenProductions
Deviantart: TheeForsakenOne
Location: Scotland
Contact:

Screen Layering Issues [Solved-ish]

#1 Post by Thee Forsaken One »

Having some odd errors with screen layering. Here are the screens in question. Note I cut out some parts (Mostly filenames of images being used) to keep it short:

Code: Select all

screen receptionArea():

    modal True
    zorder 100

    use locationDateTimeScreen("Reception","Wed 27 May",0)

Code: Select all

screen locationDateTimeScreen(l,d,t):

    zorder 1000
    fixed:

        xalign 0.0
        yalign 0.0
        fit_first True

        add "gui/AreaDateTimeBorder.png"

        imagebutton idle "gui/button.png" hover "gui/button.png" action ToggleScreen("statOverlay") xalign 0.0 yalign -9.5

        text l xalign 0.03 yalign 0.25 font "fonts/SHOWG.ttf" size 52
        text d xalign 0.93 yalign 0.25 font "fonts/SHOWG.ttf" size 52

        if t==0:
            add "gui/morningicon.png" xalign 0.995 yalign 0.1
        elif t==1:
            add "gui/middayicon.png" xalign 0.995 yalign 0.1
        else:
            add "gui/eveningicon.png" xalign 0.995 yalign 0.1

Code: Select all

screen statOverlay():

    zorder 200
    fixed:

        xalign 0.0
        yalign 0.0
        fit_first True

        add "gui/statmenu.png"
locationDateTimeScreen correctly appears on top of ReceptionArea but statOverlay appears on top of everything when the toggle button is clicked. I'm not sure what is causing this as simpler code such as:

Code: Select all

screen btn():
    zorder 100
    textbutton "open" action ToggleScreen("scr") text_color "#000"

screen scr():
    zorder 10
    add Solid("#FFF", xysize=(100,30))
Works completely fine when used.

A few things I've checked:
  • None of my screens have been appended to config.overlay_screens.
  • I am not using layers.
  • Setting the zorder of statOverlay below 100 does correctly hide it behind receptionArea but as soon as it is 100 or greater it's once again on top of everything.
I'm honestly at a loss here. Beyond some convoluted redrawing of the locationDateTimeScreen every time I press the toggle button I'm not sure what's causing this issue. Any ideas?
Last edited by Thee Forsaken One on Wed Sep 23, 2020 6:20 pm, edited 3 times in total.

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: Screen Layering Issues

#2 Post by Remix »

Your locationDateTimeScreen is likely inheriting the zorder of its parent screen receptionArea ... So it becomes 100 rather than 1000

Also, post your code in [code]Your code here[/code] tags please (to preserve formatting)
Frameworks & Scriptlets:

User avatar
Thee Forsaken One
Regular
Posts: 196
Joined: Sun Mar 01, 2009 8:10 pm
Completed: RE: Alistair++; Backstage Pass; Three Guys That Paint; The Reject Demon Toko - Ch 0; The Menagerie
Projects: Winning Hearts; Astral Hours
Organization: Forsaken Productions
Tumblr: ForsakenProductions
Deviantart: TheeForsakenOne
Location: Scotland
Contact:

Re: Screen Layering Issues

#3 Post by Thee Forsaken One »

Ah yeah. I should have realised use would probably cause that issue. I suppose I could get around it by always calling the screens to show separately instead of using use even if it's not the most elegant. 🤔

P.S. Woops, used c instead of code for my tags.

EDIT: Separating the screen calls works so solved-ish, I guess.

Post Reply

Who is online

Users browsing this forum: decocloud