Animating the text box/ say screen

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Animating the text box/ say screen

#1 Post by Kinmoku »

Hi all,

I'm wondering if it's possible to animate how the text box/ say screen appears each time dialogue shows up? Something like this:

https://youtu.be/LZS4kw2scsI?t=24s

So a simple spin, flip, rotation etc. I don't really know where to start with this so I thought I'd ask :)

Also, on a slightly different topic, is it possible to keep the text window present between pauses? I have another window in my game... a large, gradient-like text box and it's a bit excessive when it keeps flashing on and off.
Last edited by Kinmoku on Fri Mar 17, 2017 12:07 pm, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Animating the text box/ say screen

#2 Post by Ocelot »

I think, on statement will help you: https://www.renpy.org/doc/html/atl.html#on-statement
< < insert Rick Cook quote here > >

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Animating the text box/ say screen

#3 Post by Kinmoku »

Cool :) I managed to get a simple dissolve working.

Code if anyone needs:

Code: Select all

transform textdissolve:
    on show:
        alpha 0
        linear 0.2 alpha 1
        
    on hide:
        alpha 1
        linear 0.2 alpha 0

Code: Select all

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                style "namebox"
                text who id "who"

        text what id "what"
        
        at textdissolve
I'm wondering if I can separate the window background from the text though. At the moment it dissolves the whole thing, and I can't seem to get it working if I try anything else.

Also, is there a way to keep the text box present between pauses?

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Animating the text box/ say screen

#4 Post by indoneko »

Kinmoku wrote:Also, is there a way to keep the text box present between pauses?
add this :

Code: Select all

init python:
    config.window = "show" 

https://www.renpy.org/doc/html/config.h ... fig.window

But I think your modified say screen might interfere with it...
My avatar is courtesy of Mellanthe

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Animating the text box/ say screen

#5 Post by Imperf3kt »

What about using fade, instead of dissolve?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Animating the text box/ say screen

#6 Post by Milkymalk »

While we're at it, I'm trying to do this with the NVL-window and have no idea where I should put the at-statement.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Animating the text box/ say screen

#7 Post by indoneko »

Milkymalk wrote:While we're at it, I'm trying to do this with the NVL-window and have no idea where I should put the at-statement.
IINM that would be in screens.rpy, inside the screen nvl_dialogue(dialogue): block (put it under the text d.what: line)
My avatar is courtesy of Mellanthe

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Animating the text box/ say screen

#8 Post by Milkymalk »

Nope, no effect whatsoever, sorry. The window still just plops up in an instant instead of fading in (I'm using the exact transform Kinmoku posted, but with linear 1.0). But thanks for trying ;)
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Animating the text box/ say screen

#9 Post by Kinmoku »

indoneko wrote: But I think your modified say screen might interfere with it...
Thank you :) I figured as much... I'll have to decide which style to go for! Or is there the possibility to set up 2 "say" styles? I imagine that'd be pretty complex!
Milkymalk wrote:Nope, no effect whatsoever, sorry. The window still just plops up in an instant instead of fading in (I'm using the exact transform Kinmoku posted, but with linear 1.0). But thanks for trying ;)
How odd. I'd be curious to know if this is possible as well.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Animating the text box/ say screen

#10 Post by Milkymalk »

I got it to work when I put it right under

Code: Select all

        style "nvl_window"
in the "nvl" screen, but it plays the ATL every time a new line appears, so you have to change this

Code: Select all

transform nvl_dissolve:
    on show:
        alpha 0.0
        linear 1.0 alpha 1.0
        
    on hide:
        alpha 1.0
        linear 1.0 alpha 0.0
into this

Code: Select all

transform nvl_dissolve:
    on show:
        linear 1.0 alpha 1.0
        
    on hide:
        linear 1.0 alpha 0.0
So the on show only works with alpha fades and similar effects, while you typically don't hide the window unless it's visible so no problem there.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

Post Reply

Who is online

Users browsing this forum: No registered users