How to fade namebox in and out?

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
Arianne
Newbie
Posts: 13
Joined: Fri May 27, 2016 3:00 am
Contact:

How to fade namebox in and out?

#1 Post by Arianne »

I'm currently having a problem with the namebox for my character dialogue boxes - it is a separate file to my actual dialogue box, and whilst the dialogue box can fade in and out nicely the namebox just pops in and I can't seem to get it to transition in correctly. Any pointers?

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: How to fade namebox in and out?

#2 Post by mobychan »

depends on your code, but maybe try looking at "at":

Code: Select all

screen a():
    fixed:
        at my_custom
        # Other Screen Stuff you need

Arianne
Newbie
Posts: 13
Joined: Fri May 27, 2016 3:00 am
Contact:

Re: How to fade namebox in and out?

#3 Post by Arianne »

sorry - I'm a bit new to all this - where should I try putting that code?

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: How to fade namebox in and out?

#4 Post by mobychan »

As I said, it all depends on your code, I have no idea what your code looks like

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: How to fade namebox in and out?

#5 Post by SundownKid »

In screens.rpy, you have to change:

Code: Select all

if who:            
            window:
                style "say_who_window"

                text who:
                    id "who"
To:

Code: Select all

if who:            
            window at alpha_dissolve:
                style "say_who_window"

                text who:
                    id "who"
Then create a transform:

Code: Select all

transform alpha_dissolve:
    alpha 0.0
    linear 0.5 alpha 1.0
    on hide:
        linear 0.5 alpha 0
You can change the timing of it if you want to make it faster or slower. The only problem is that it will fade back in whenever there is new line of text. I am not totally sure how to make it fade in/out only when there is no namebox.

Arianne
Newbie
Posts: 13
Joined: Fri May 27, 2016 3:00 am
Contact:

Re: How to fade namebox in and out?

#6 Post by Arianne »

SundownKid wrote:In screens.rpy, you have to change:

Code: Select all

if who:            
            window:
                style "say_who_window"

                text who:
                    id "who"
To:

Code: Select all

if who:            
            window at alpha_dissolve:
                style "say_who_window"

                text who:
                    id "who"
Then create a transform:

Code: Select all

transform alpha_dissolve:
    alpha 0.0
    linear 0.5 alpha 1.0
    on hide:
        linear 0.5 alpha 0
You can change the timing of it if you want to make it faster or slower. The only problem is that it will fade back in whenever there is new line of text. I am not totally sure how to make it fade in/out only when there is no namebox.
I tried that but it came up with this error:

"u'alpha_dissolve' is not a keyword argument or valid child for the transform statement."

Post Reply

Who is online

Users browsing this forum: Google [Bot]