Creating a slidein transition [SOLVED]

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
oatnoodles
Regular
Posts: 75
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Creating a slidein transition [SOLVED]

#1 Post by oatnoodles »

Hello! I'm looking to make a transition for character portraits. It's meant to be for when there's already one portrait on screen and a second character comes into the scene. I know movein already exists, but I'd like it to fade in from the side it's coming from (left or right) instead of sliding in all the way from off-screen. I'd also like to be able to move over the portrait that's already there.

Reference for what I'd like to recreate:
Image
Last edited by oatnoodles on Fri May 31, 2024 5:28 pm, edited 2 times in total.
Ren'py amateur looking to learn as much as possible! Please be patient with me.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1057
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Creating a slidein transition

#2 Post by m_from_space »

oatnoodles wrote: Fri May 24, 2024 5:35 pm Hello! I'm looking to make a transition for character portraits.
A "transition" is something that happens between two states of a scene, so for example if you change the background from one thing to another and you use the keyword "with". This can be a blend effect of some sort that affects the whole scene.

You probably just mean a simple "transform", so to animate your character showing up by using the keyword "at".
... I'd like it to fade in from the side it's coming from (left or right) instead of sliding in all the way from off-screen.
By "fading in" you mean moving and fading in or what exactly?

Code: Select all

transform move_and_fade_from_right():
    xanchor 0.0 xpos 1.0 alpha 0.0
    linear 3.0 xanchor 0.5 xpos 0.75 alpha 1.0

label start:
    show eileen at move_and_fade_from_right
I'd also like to be able to move over the portrait that's already there.
Using xoffset is the way to go here.

Code: Select all

transform move_a_bit(x):
    easeout 1.0 xoffset x

label start:
    scene eileen at center
    e "Hello!"
    
    # move eileen 100 pixels to the right
    show eileen at move_a_bit(100)
    
    e "Woah, what's going on?"
    
    # move her to the left instead
    show eileen at move_a_bit(-50)
    
    e "I'm feeling dizzy."
    
    # move her to the original position
    show eileen at move_a_bit(0)

User avatar
oatnoodles
Regular
Posts: 75
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: Creating a slidein transition [SOLVED]

#3 Post by oatnoodles »

thank you! i ended up making a few different transforms for the different positions of the characters:

Code: Select all

# Move to left position --------------------------------------

transform move_to_left:
    xanchor 0.5 xpos 0.5 alpha 1.0
    linear 0.5 xanchor 0.5 xpos 0.35 alpha 1.0

# Move to center position from left ---------------------------

transform move_to_center_from_left:
    xanchor 0.5 xpos 0.35 alpha 1.0
    linear 0.25 xanchor 0.5 xpos 0.5 alpha 1.0

# Right portrait enter ---------------------------------------

transform right_enter():
    zoom 0.3 xanchor 0.0 xpos 0.35 alpha 0.0
    linear 0.25 xanchor 0.5 xpos 0.65 alpha 1.0

And here's how it looks in-game!

Image
Ren'py amateur looking to learn as much as possible! Please be patient with me.

Post Reply

Who is online

Users browsing this forum: No registered users