[Solved] Easein / easeout on the overlay layer

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
goldo
Regular
Posts: 127
Joined: Mon Jan 23, 2017 8:23 am
Contact:

[Solved] Easein / easeout on the overlay layer

#1 Post by goldo »

Hi guys,

So, I'm trying to have easein / easeout transitions that apply to the overlay layer. This is because I am displaying an image on top of a renpy screen (the master layer appears behind the screen so I can't use it). I want the image to enter from the left, then swipe out to the right.

I already know I should use define.move_transitions() to create a different 'ease' move family for the overlay layer that I called 'easeol'.

The strange thing is, this works just fine for the entering transition (easeolinleft), but the leaving transition just won't work. The image hides without any transition at all.

Here is the code snippet. I know very little about transitions, so I'm probably doing something wrong, but I can't figure it out:

Code: Select all

label challenge(result, _sound=None):
    
    $ define.move_transitions("easeol", 0.5, _ease_time_warp, _ease_in_time_warp, _ease_out_time_warp, layers=["overlay"])
    
    if result:
        if _sound:
            play sound s_success
        
        show success onlayer overlay with easeolinleft
        pause 1.0
        hide success with easeoloutright
        
    else:
        if _sound:
            play sound s_crash
            
        show failure onlayer overlay with easeolinleft
        pause 1.0
        hide failure with easeoloutright
        
    return
        
Last edited by goldo on Sun Jul 29, 2018 5:15 am, edited 1 time in total.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Easein / easeout on the overlay layer

#2 Post by MaydohMaydoh »

I played around with it for a bit and it seems to work if you make a new layer to display the image on.

Code: Select all

define config.layers = [ 'master', 'transient', 'screens', 'overlay', 'customlayer' ]
You also need to tell it what layer to hide on as well it seems.

Code: Select all

show success onlayer customlayer with easeolinleft
pause 1.0
hide success onlayer customlayer with easeoloutright
I don't know much about layers so I can't tell you why it doesn't work with overlay, but I do know it's used to display overlay functions. So maybe something to do with that.

goldo
Regular
Posts: 127
Joined: Mon Jan 23, 2017 8:23 am
Contact:

Re: Easein / easeout on the overlay layer

#3 Post by goldo »

It works now! Thank you so much!!! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]