Fade in and out characters

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
FlannelNasa
Newbie
Posts: 3
Joined: Wed Jul 04, 2018 1:19 pm
Contact:

Fade in and out characters

#1 Post by FlannelNasa »

Hello.

For my VN I'm trying to make the character fade into a larger version of itself as it talks, and I have an issue as when I try to do something like

show A at MidLeft, zoomz with dissolve
hide A at MidLeft, zoomz with dissolve
show A at MidLeft

It looks clunky with the smaller A appearing after the larger A has completely dissolved

(zoomz is defined as zoom in at 1.1 [I think this had to be done because I couldn't have multiple 'at' statements], and MidLeft is a location I made due to unhappiness with the default left)

I want these things to happen smoothly so the larger A becomes the smaller A, (as if coming forward as it talks and going back when it's finished)
I've looked at the paralell transitions but I cannot understand them from the wiki at all.
Thanks in advance for anyone able to help or explain paralell transitions for this context if they are what must be used

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Fade in and out characters

#2 Post by Donmai »

Even though I can't say I fully understood what you want, I believe transitions are not what you need. You can try some ATL instead.
ATL documentation is here: https://www.renpy.org/doc/html/atl.html ... n-language
You can find examples of ATL code in the Cookbook section.
ATL transforms can be used when showing and hiding displayables. Here is an example:

Code: Select all

transform zoom_dissolve:
    alpha .0 zoom .5
    linear .5 zoom 1.0 alpha 1.0
    on hide:
        alpha 1.0 zoom 1.0
        linear .5 alpha .0 zoom .5
You can use this transform this way:

Code: Select all

label start:
    scene bg room
    show eileen happy at zoom_dissolve, center
    e "Hi. Just passing by. So long."
    hide eileen happy
    pause # this pause isn't necessary, it's here so you have time to see the character "going away".
    return # ends the game
    
Usually I create a new script and put all my ATL code there.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

FlannelNasa
Newbie
Posts: 3
Joined: Wed Jul 04, 2018 1:19 pm
Contact:

Re: Fade in and out characters

#3 Post by FlannelNasa »

Hey, sorry I should have been more clear

What im looking for is if A and B are having a conversation, while A talks, he is enlarged and B is normal size, and then when B stats talking, A shrinks back down to normal size, and at the exact same time, B is being enlargened to ensure the viewer knows who is talking. I think the solution you provided above is for a slightly different problem. Thankyou very much for any help though.

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Fade in and out characters

#4 Post by rames44 »

A suggestion:
1. Create a “zoom up transform” that starts at “small” and then zooms up to “large” over a fraction of a second using ATL
2. Create the reverse transform.
3. When you switch from one character another, do the “show” WITHOUT a dissolve.

So when a character starts to speak, the “small” image will be immediately replaced by one of the same size that then zooms up, and when one stops speaking, the “large” image will be immediately replaced by another of the same size that then zooms down.

(AFK, right now, so can’t write the code for you, but maybe you follow the idea)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Fade in and out characters

#5 Post by Donmai »

No problem. ATL is still the way, though. :)
Take a look here, even if you can't read Russian (I can't, even in World Cup's time):
http://renpyfordummies.blogspot.com/2018/05/2.html
You can use Google translator to undertand the text. There's a project download link right above the picture.
It still may be not exactly what you want, but we're getting there. :lol:
Thanks to Irina Lazareva, for introducing me to that blog.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

FlannelNasa
Newbie
Posts: 3
Joined: Wed Jul 04, 2018 1:19 pm
Contact:

Re: Fade in and out characters

#6 Post by FlannelNasa »

The link you sent shows a program with people becoming highlighted as they talk, which does seem quite cool but the friend im making this one is pretty specific about the enlargening thing discussed. The addition by rames44 seems like it would work but im not sure at all how to code the zoom up transform. I've read the stuff on ATL and I can't really understand it as I dont know how to stop the shrinking at a certain point

Thanks again if you can 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: Fade in and out characters

#7 Post by Per K Grok »

FlannelNasa wrote: Thu Jul 05, 2018 5:19 am Hey, sorry I should have been more clear

What im looking for is if A and B are having a conversation, while A talks, he is enlarged and B is normal size, and then when B stats talking, A shrinks back down to normal size, and at the exact same time, B is being enlargened to ensure the viewer knows who is talking. I think the solution you provided above is for a slightly different problem. Thankyou very much for any help though.

I might look at this too simply, but the way it would seem to be natural to tackle this would be to have only one image for each of the characters, not a big and small version. The image would be sized for the large size. When the character is to be small just use the zoomed down big character.

So you might start out with two small characters

Code: Select all

show Bob Normal:
      -----
      zoom 0.5
      
show Bill Normal:
     ------
     zoom 0.5  
When the characters talk you would go.

Code: Select all


show Bob Normal:    # Bob Zoom up at the same time as dialogue 1 is shown
      -----
      zoom 0.5
      linear 1.0 zoom 1.0
      
Bob "Blaha blaha blaha"   # dialogue 1

###########################################################

show Bob Normal:    # zoom down Bob the same time as Bill is zoomed up and dialogue 2 is shown
      -----
      zoom 1.0
      linear 1.0 zoom 0.5
      
show Bill Normal:  # zoom up Bill
      -----
      zoom 0.5
      linear 1.0 zoom 1.0
      
Bill "Blaha blaha blaha"  # dialogue 2

########################################################

show Bob Normal:  # reverse from dialogue 2
      -----
      zoom 0.5
      linear 1.0 zoom 1.0
      
show Bill Normal:
      -----
      zoom 1.0
      linear 1.0 zoom 0.5
      
Bob "Blaha blaha blaha"    # dialogue 3
##################################################
show Bob Normal:   # zoom down bob after dialogue 3
      -----
      zoom 1.0
      linear 1.0 zoom 0.5


I think this would do what I believe you are looking for.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]