Previous Text Lines fading in NVL mode.

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
Winter.Scaze
Newbie
Posts: 1
Joined: Tue May 29, 2012 12:21 pm
Contact:

Previous Text Lines fading in NVL mode.

#1 Post by Winter.Scaze »

I was looking through the documentation and it didn't seem like there was a straightfoward way to do this. Can anyone instruct me on how to implement this feature (if it's possible?)

Basically, in NVL mode, as the user goes through the lines of text, I only want the most recent line to be displayed with full opacity, the previous lines that are on screen should be faded. I.E. Everytime a new line is displayed on screen, the previous line needs to fade out.

Thank you!

User avatar
Samidarenina
Regular
Posts: 137
Joined: Sun Aug 01, 2010 1:21 pm
Contact:

Re: Previous Text Lines fading in NVL mode.

#2 Post by Samidarenina »

I don't think that's possible as far as I know. The way the text works right now wouldn't allow for it.


But I could be wrong. I'd be happy if someone could prove me wrong here.

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: Previous Text Lines fading in NVL mode.

#3 Post by FatUnicornGames »

I'm going to bump this because I would like to know if anybody has an answer. :D
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Previous Text Lines fading in NVL mode.

#4 Post by apricotorange »

I can't seem to get the animation working right, but the following should be close to what you're looking for:

Code: Select all

transform nvl_faded:
    alpha 0.5

screen nvl:

    window:
        style "nvl_window"

        has vbox:
            style "nvl_vbox"

        # Display dialogue.
        for i in range(0, len(dialogue)):
            $ (who, what, who_id, what_id, window_id) = dialogue[i]
            window:
                id window_id

                has hbox:
                    spacing 10

                if i == len(dialogue) - 1:
                    if who is not None:
                        text who id who_id

                    text what id what_id

                else:
                    if who is not None:
                        text who id who_id at nvl_faded

                    text what id what_id at nvl_faded

        

        # Display a menu, if given.
        if items:

            vbox:
                id "menu"

                for caption, action, chosen in items:

                    if action:

                        button:
                            style "nvl_menu_choice_button"
                            action action

                            text caption style "nvl_menu_choice"

                    else:

                        text caption style "nvl_dialogue"

    add SideImage() xalign 0.0 yalign 1.0
    
    use quick_menu

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: Previous Text Lines fading in NVL mode.

#5 Post by FatUnicornGames »

Awesome! I'll play around with it.
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: Previous Text Lines fading in NVL mode.

#6 Post by FatUnicornGames »

Cool I put it in and it greys out the preceding text. I think I will leave it in. If anybody figures out how to have it fade out the rest of the way let me know.
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

User avatar
Samidarenina
Regular
Posts: 137
Joined: Sun Aug 01, 2010 1:21 pm
Contact:

Re: Previous Text Lines fading in NVL mode.

#7 Post by Samidarenina »

I've modified the code a bit to throw in the fade, too.

Code: Select all

transform nvl_faded:
    linear .5 alpha 0.5
transform nvl_faded2:
    alpha 0.5
screen nvl:

    window:
        style "nvl_window"

        has vbox:
            style "nvl_vbox"

        # Display dialogue.
        for i in range(0, len(dialogue)):
            $ (who, what, who_id, what_id, window_id) = dialogue[i]
            window:
                id window_id

                has hbox:
                    spacing 10

                if i == len(dialogue) - 1:
                    if who is not None:
                        text who id who_id

                    text what id what_id

                else:
                    if i == len(dialogue) - 2:
                        if who is not None:
                            text who id who_id at nvl_faded

                        text what id what_id at nvl_faded
                    else
                        if who is not None:
                            text who id who_id at nvl_faded2

                        text what id what_id at nvl_faded2

        

        # Display a menu, if given.
        if items:

            vbox:
                id "menu"

                for caption, action, chosen in items:

                    if action:

                        button:
                            style "nvl_menu_choice_button"
                            action action

                            text caption style "nvl_menu_choice"

                    else:

                        text caption style "nvl_dialogue"

    add SideImage() xalign 0.0 yalign 1.0
It should be noted that it does have one bug though. When using extend and {w}/{p} it fades the last line one more time.

But if you don't use neither of those, it should work perfectly.
I'll try finding a way to fix this bug in the meanwhile.


EDIT:
Also, let me know if someone finds a way to also let down the transparency of outlines.

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: Previous Text Lines fading in NVL mode.

#8 Post by FatUnicornGames »

It looks great to me! Thanks so much!
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

Post Reply

Who is online

Users browsing this forum: Nightpxel