[Solved] How can I show/hide screen without de fade in/out effect?

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
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[Solved] How can I show/hide screen without de fade in/out effect?

#1 Post by Nanahs »

For example, there's a label:

Code: Select all

label bedroom:
    scene bedromm
    show screen lights
The "screen lights" always have that fadein effect when you start the label.
Like this:
Image

I wanted the screen to appear directly as it is on the second image. Without the fadein.

Is there a way to delete this fadein/fadeout effect when using call/show/hide screen?

When using call/show/hide screen it would appear/disappear out of a blue. That's what I'm going for though :lol:

PS: Also when using "action Return('park')" it also has a fadein/out effect, even if I'm not using something like (with fade):

Code: Select all

label park:
    scene park
    with fade
To make it short: I don't want the game to use fadein/out if I didn't ask to :oops: :lol:

Thanks.
Last edited by Nanahs on Thu Jan 03, 2019 10:04 am, edited 4 times in total.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#2 Post by Per K Grok »

Nanahs wrote: Wed Jan 02, 2019 3:33 pm For example, there's a label:

Code: Select all

label bedroom:
    scene bedromm
    show screen lights
The "screen lights" always have that fadein effect when you start the label.
Like this:
Image

I wanted the screen to appear directly as it is on the second image. Without the fadein.

Is there a way to delete this fadein/fadeout effect when using call/show/hide screen?

When using call/show/hide screen it would appear/disappear out of a blue. That's what I'm going for though :lol:

PS: Also when using "action Return('park')" it also has a fadein/out effect, even if I'm not using something like (with fade):

Code: Select all

label park:
    scene park
    with fade

To make it short: I don't want the game to use fadein/out if I didn't ask to :oops: :lol:

Thanks.

Nice background :)

call/show/hide screen should be without fadein/out as a standard as far as I can understand.

Could there be something in your code that has changed that?

Do you by any chance have a code line somewhere with 'renpy.transition' in it?

If you make a new project from scratch with just the background and the screen, do you still get the fadein/out effect? If not, that is a strong indication you got something in your ordinary project that causes this.

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#3 Post by Nanahs »

Per K Grok wrote: Wed Jan 02, 2019 6:30 pm
Nanahs wrote: Wed Jan 02, 2019 3:33 pm For example, there's a label:

Code: Select all

label bedroom:
    scene bedromm
    show screen lights
The "screen lights" always have that fadein effect when you start the label.
Like this:
Image

I wanted the screen to appear directly as it is on the second image. Without the fadein.

Is there a way to delete this fadein/fadeout effect when using call/show/hide screen?

When using call/show/hide screen it would appear/disappear out of a blue. That's what I'm going for though :lol:

PS: Also when using "action Return('park')" it also has a fadein/out effect, even if I'm not using something like (with fade):

Code: Select all

label park:
    scene park
    with fade

To make it short: I don't want the game to use fadein/out if I didn't ask to :oops: :lol:

Thanks.

Nice background :)

call/show/hide screen should be without fadein/out as a standard as far as I can understand.

Could there be something in your code that has changed that?

Do you by any chance have a code line somewhere with 'renpy.transition' in it?

If you make a new project from scratch with just the background and the screen, do you still get the fadein/out effect? If not, that is a strong indication you got something in your ordinary project that causes this.
Thanks :)

The thing is that I'm using a daytime code.
According to the hour, the bedroom window changes. There's a an animated window screen with sun, another one with moon, etc.
But it was not "updating". Sometimes the window "Night" should already appear but the code was not doing it. So I added a timer that refreshes the page each 5 minutes.

I did it like this:

Code: Select all

screen check_daytime():
    timer 300 repeat True action Jump("windowchange")
    

    
label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5]:
        hide screen evening
        show screen night

    if hour in [6, 7, 8, 9, 10, 11]:
        hide screen night
        show screen morning
        
    if hour in [12, 13, 14, 15, 16]:
        hide screen morning
        show screen afternoon

    if hour in [17, 18, 19]:
        hide screen afternoon
        show screen evening    
And also like that:

Code: Select all

screen check_daytime():
    timer 300 repeat True action Jump("windowchange")    
       
    
label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 

label windowchange: 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5]:
        hide screen evening
        show screen night

    if hour in [6, 7, 8, 9, 10, 11]:
        hide screen night
        show screen morning
        
    if hour in [12, 13, 14, 15, 16]:
        hide screen morning
        show screen afternoon

    if hour in [17, 18, 19]:
        hide screen afternoon
        show screen evening      
It works nice.
The problem is that whenever the timer jumps to the label again to "refresh/update" the windows screen, it makes a fadein/out effect and it looks weird.
So I thought that if I could delete this fadein/out effect from screens it would stop.
None of my labels has a fade. And I also didn't edit my options.

I just wanted the time to "refresh" so that the window would change properly. But this fadein/out effect is just weird.
Like, you're in the middle of a conversation in the game and the label fades in/out out of a sudden :?: :lol:

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#4 Post by Per K Grok »

Nanahs wrote: Wed Jan 02, 2019 3:33 pm
---------------

The problem is that whenever the timer jumps to the label again to "refresh/update" the windows screen, it makes a fadein/out effect and it looks weird.

-----------

With thees additions to your script show/hide will only run when the screen need to be changed.
That will at least make the problem smaller

Code: Select all

default daypart=0    

screen check_daytime():
    timer 300 repeat True action Jump("windowchange")    
   
label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 

label windowchange: 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5] and daypart != 1:    
        hide screen evening
        show screen night
        $ daypart=1                                    

    if hour in [6, 7, 8, 9, 10, 11] and daypart != 2:  
        hide screen night
        show screen morning
        $ daypart=2                               
         
    if hour in [12, 13, 14, 15, 16] and daypart != 3:   
        hide screen morning
        show screen afternoon
        $ daypart=3                  

    if hour in [17, 18, 19] and daypart != 4:      
        hide screen afternoon
        show screen evening      
        $ daypart=4            
        

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#5 Post by Nanahs »

Per K Grok wrote: Thu Jan 03, 2019 2:04 am
Nanahs wrote: Wed Jan 02, 2019 3:33 pm
---------------

The problem is that whenever the timer jumps to the label again to "refresh/update" the windows screen, it makes a fadein/out effect and it looks weird.

-----------

With thees additions to your script show/hide will only run when the screen need to be changed.
That will at least make the problem smaller

Code: Select all

default daypart=0    

screen check_daytime():
    timer 300 repeat True action Jump("windowchange")    
   
label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 

label windowchange: 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5] and daypart != 1:    
        hide screen evening
        show screen night
        $ daypart=1                                    

    if hour in [6, 7, 8, 9, 10, 11] and daypart != 2:  
        hide screen night
        show screen morning
        $ daypart=2                               
         
    if hour in [12, 13, 14, 15, 16] and daypart != 3:   
        hide screen morning
        show screen afternoon
        $ daypart=3                  

    if hour in [17, 18, 19] and daypart != 4:      
        hide screen afternoon
        show screen evening      
        $ daypart=4            
        
Oh, thank you So much! I didn't know about that code.

The only problem now is that if I go back to this label, the window is not there anymore.

Oh, my... I better leave it like that :lol:

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#6 Post by Nanahs »

Oh! I did something that worked:

Code: Select all

label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5]:
        hide screen evening
        show screen night
        $startTime= 20
        $endTime= 21

    if hour in [6, 7, 8, 9, 10, 11]:
        hide screen night
        show screen morning
        $startTime= 6
        $endTime= 11

    if hour in [12, 13, 14, 15, 16]:
        hide screen morning
        show screen afternoon
        $startTime= 12
        $endTime= 16
        
    if hour in [17, 18, 19]:
        hide screen afternoon
        show screen evening    
        $startTime= 17
        $endTime= 19
Anyway, thank you Per K Grok for your help! :)

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#7 Post by Per K Grok »

Nanahs wrote: Thu Jan 03, 2019 10:03 am Oh! I did something that worked:

Code: Select all

label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5]:
        hide screen evening
        show screen night
        $startTime= 20
        $endTime= 21

    if hour in [6, 7, 8, 9, 10, 11]:
        hide screen night
        show screen morning
        $startTime= 6
        $endTime= 11

    if hour in [12, 13, 14, 15, 16]:
        hide screen morning
        show screen afternoon
        $startTime= 12
        $endTime= 16
        
    if hour in [17, 18, 19]:
        hide screen afternoon
        show screen evening    
        $startTime= 17
        $endTime= 19
Anyway, thank you Per K Grok for your help! :)

Ok. I don't see what startTime and enTime does but if it works that fine.

If you for some reason would like to go back to my idea you could solve the problem of not getting a screen going back to the bedroom by adding one line to the bedroom label.

Code: Select all

label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    $ daypart=0   
    

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: How can I show/hide screen without de fade in/out effect?

#8 Post by Nanahs »

Per K Grok wrote: Thu Jan 03, 2019 12:59 pm
Nanahs wrote: Thu Jan 03, 2019 10:03 am Oh! I did something that worked:

Code: Select all

label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    
    $hour = datetime.datetime.now().hour
    
    if hour in [20, 21, 22, 23, 00, 1, 2, 3, 4, 5]:
        hide screen evening
        show screen night
        $startTime= 20
        $endTime= 21

    if hour in [6, 7, 8, 9, 10, 11]:
        hide screen night
        show screen morning
        $startTime= 6
        $endTime= 11

    if hour in [12, 13, 14, 15, 16]:
        hide screen morning
        show screen afternoon
        $startTime= 12
        $endTime= 16
        
    if hour in [17, 18, 19]:
        hide screen afternoon
        show screen evening    
        $startTime= 17
        $endTime= 19
Anyway, thank you Per K Grok for your help! :)

Ok. I don't see what startTime and enTime does but if it works that fine.

If you for some reason would like to go back to my idea you could solve the problem of not getting a screen going back to the bedroom by adding one line to the bedroom label.

Code: Select all

label bedroomanna:
    
    scene bedroom1   
    show screen check_daytime 
    $ daypart=0   
    
Ok :) Thank you for all your help! :)

Post Reply

Who is online

Users browsing this forum: Kocker