[solved]Image not showing above UI

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
Cristiander
Regular
Posts: 33
Joined: Sat Mar 04, 2017 8:19 am
Contact:

[solved]Image not showing above UI

#1 Post by Cristiander » Sun May 06, 2018 12:35 pm

So I'm working on a scene here and I just can't get an image to show up above the UI. I read that I'm supposed to put it in the screen layer and to give it a large Z in order to do it but it's just not working.

I gave more details about what should and what is happening in the code below.


Below is the image that should be drawn above the UI

Code: Select all

image whitetint:
  Solid("#ffffff")
  additive 1.0
This is the actual code

Code: Select all

    
    nvl_ "The screen is normal now."

    show whitetint onlair screens zorder 1001:
        alpha 0.0
        linear 2.0 alpha 0.3

    nvl_ "~The image is now supposed to be drawn above the UI~ (But in my case it's not drawn above the UI,)"
       
    show whitetint onlair screens zorder 1001:
        alpha 0.6
        linear 2.0 alpha 1.0
        
    nvl_ "~Now the image is supposed to cover the UI completly, so that the NVL UI is no longer visible.~ (But in my case the UI is fully visible, since it's drawn above the image) "
    
    nvl hide
    show whitetint onlair master
    hide whitetint onlair screens
    
    "~Now the background is supposed to be white and this text box is supposed to be drawn above it, since I hid the image on the screens layer and replaced it with an image in the master layer~ (But instead the image is hid from both the master and the screen layers, so the background is not white.)"
    
    nvl clear
    hide whitetint onlair master with Dissolve(2.0)
    
    nvl_ "~Now the screen should be back to normal.~"
Last edited by Cristiander on Sun May 06, 2018 2:10 pm, edited 1 time in total.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Image not showing above UI

#2 Post by kivik » Sun May 06, 2018 1:31 pm

the keyword is onlayer not onlair.

If you want to add animations to it with the linear alpha - you're better off creating a transform that takes the alpha values. I think something like below should work:

Code: Select all

transform custom_alpha(start_alpha, end_alpha):
    alpha start_alpha
    linear 2.0 alpha end_alpha

...

show whitetint onlayer screens zorder 1001 at custom_alpha(0.0, 0.3)

Cristiander
Regular
Posts: 33
Joined: Sat Mar 04, 2017 8:19 am
Contact:

Re: Image not showing above UI

#3 Post by Cristiander » Sun May 06, 2018 2:10 pm

I was afraid it was gonna be a small mispelling. Thank you :)
I find it strange that I didn't get any error messages despite mispelling onlayer. Oh well...

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: [solved]Image not showing above UI

#4 Post by kivik » Sun May 06, 2018 2:16 pm

I think it's because Renpy uses image name fall backs:

Code: Select all

image test:
    Solid("#fff")

label start:
    show test some random tag names
    "This will just show the image test"
    show test2
    "You what mate?"
Instead of crashing because I haven't got an image called "test some random tag names", it'd fall back to "test some random tag", then "test some random", "test some" until it reaches "test" and finds an image, so it shows that.

Even in the second case of test2 - it just shows the pigtail girl silhouette instead of crashing so you can visually see that something's not right, and what the image name is so you can fix it.

It can of course be confusing as a result!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Hojoo