How do you make animated text?

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
Erthar
Newbie
Posts: 4
Joined: Wed May 08, 2013 5:58 pm
Contact:

How do you make animated text?

#1 Post by Erthar »

I want to make animated text in my VN. The way it's animated is that it would be a random combination of characters and then change into another set of random characters in less than a second, repeating uninterruptedly. Is there a way to do that? Thanks.

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

Re: How do you make animated text?

#2 Post by apricotorange »

If you're just talking about dialogue, you can use the {w} and {nw} text tags; see http://www.renpy.org/doc/html/text.html ... -text-tags . If you're using screen language, it supports timers; see http://www.renpy.org/doc/html/screens.html#timer .

If that isn't enough, please describe the effect in more detail.

User avatar
Nuxill
Veteran
Posts: 464
Joined: Sat Sep 25, 2010 4:50 pm
Projects: No Friend
Tumblr: nuxill
itch: nuxill
Contact:

Re: How do you make animated text?

#3 Post by Nuxill »

I think you might have to do that with images of the text and ATL http://www.renpy.org/doc/html/atl.html
I have no idea if it would be possible to do with code.

Erthar
Newbie
Posts: 4
Joined: Wed May 08, 2013 5:58 pm
Contact:

Re: How do you make animated text?

#4 Post by Erthar »

Yeah, I'm talking about the dialogue. I found an example here: http://www.youtube.com/watch?v=0mcnEPstYTE. Skip to 1:29. It's the text that changes colours and characters.

User avatar
Nuxill
Veteran
Posts: 464
Joined: Sat Sep 25, 2010 4:50 pm
Projects: No Friend
Tumblr: nuxill
itch: nuxill
Contact:

Re: How do you make animated text?

#5 Post by Nuxill »

Erthar wrote:Yeah, I'm talking about the dialogue. I found an example here: http://www.youtube.com/watch?v=0mcnEPstYTE. Skip to 1:29. It's the text that changes colours and characters.
Yeah, that's the kind of thing I thought you were talking about. I still think it would be best to make a bunch of images of the text that look like how you want it to be and then animate that with ATL. You'd probably be able to do it with extra python programming but I have no idea how.

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

Re: How do you make animated text?

#6 Post by apricotorange »

Here's how you can do that effect:

Code: Select all

image flashingtext1:
    crop (0, 0, 100, 22)
    Text("{color=#f00}as{/color}{color=#0f0}df{/color}")
    pause 1.0
    Text("{color=#ff0}zx{/color}{color=#00f}cvvv{/color}")
    pause 1.0
    repeat

label start:
    "This is some {image=flashingtext1} text.
     Some more text to make it take up another line blah blah blah.
     Some more text to make it take up another line blah blah blah."
    return

Erthar
Newbie
Posts: 4
Joined: Wed May 08, 2013 5:58 pm
Contact:

Re: How do you make animated text?

#7 Post by Erthar »

Thanks apricotorange! That's exactly what I want! And thank you Nuxill for your time!

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: How do you make animated text?

#8 Post by xavimat »

For letters changing and appearing (I know, this is another effect), you can try this:

EDIT: There is a better way in the next post.

Code: Select all

image ft:    
    choice:
        Text("{color=#f00}s{/color}")
    choice:
        Text("{color=#ff0}x{/color}")
    choice:
        Text("{color=#f00}θ{/color}")
    choice:
        Text("{color=#ff0}ω{/color}")
    choice:
        Text("{color=#f0f}שׂ{/color}")
    choice:
        Text("{color=#ff0}φ{/color}")
    choice:
        Text("{color=#00f}c{/color}")
    choice:
        Text("{color=#f0f}ד{/color}")
    choice:
        Text("{color=#f00}σ{/color}")
    choice:
        Text("{color=#ff0}ג{/color}")
    pause .05
    repeat

# The game starts here.
label start:
    "{image=ft}{w=.2}{nw}"
    "T{image=ft}{w=.2}{nw}"
    "Th{image=ft}{w=.2}{nw}"
    "Thi{image=ft}{w=.2}{nw}"
    "This {image=ft}{w=.2}{nw}"
    "This i{image=ft}{w=.2}{nw}"
    "This is {image=ft}{w=.2}{nw}"
    "This is s{image=ft}{w=.2}{nw}"
    "This is so{image=ft}{w=.2}{nw}"
    "This is som{image=ft}{w=.2}{nw}"
    "This is some {image=ft}{w=.2}{nw}"
    "This is some t{image=ft}{w=.2}{nw}"
    "This is some te{image=ft}{w=.2}{nw}"
    "This is some tex{image=ft}{w=.2}{nw}"
    "This is some text."
Last edited by xavimat on Fri May 10, 2013 9:25 am, edited 3 times in total.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: How do you make animated text?

#9 Post by xavimat »

Doing that with a function:

Put this in another ".rpy" file in your "game" directory, for example "flashtext.rpy":

Code: Select all

## flashtext
## (cc-by) xavimat, 2013
## based on apricotorange's code

init python:
    
    def ft(what, who = None):
        
        for i in range(len(what)):           # A loop, letter by letter
            text = what[:i]
            text = "{cps=0}" + text           # The {cps=0} makes the speed independent of the normal "say" statements
            text += "{image=flash_text_image}{/cps}{nw}"   # Add "{w=0.5}" between "{/cps}" and "{nw}" to slow down the text
            renpy.say(who,text)

        renpy.say(who, what + "{fast}")   # The last one, with all the text


image flash_text_image:
    # Change the colors as you like, or delete the color-tags, if you don't want the color changing
    # Add, delete and/or change the letters as you like

    choice:
        Text("{color=#f00}s{/color}")  
    choice:
        Text("{color=#ff0}x{/color}")
    choice:
        Text("{color=#f00}θ{/color}")
    choice:
        Text("{color=#ff0}ω{/color}")
    choice:
        Text("{color=#f0f}שׂ{/color}")
    choice:
        Text("{color=#ff0}φ{/color}")
    choice:
        Text("{color=#00f}c{/color}")
    choice:
        Text("{color=#f0f}ד{/color}")
    choice:
        Text("{color=#0f0}σ{/color}")
    choice:
        Text("{color=#ff0}ג{/color}")

    pause .05    # This controls the speed of the changing letters, the lower, the faster

    repeat
Then, in your script you can use it this way:

Code: Select all

label start:
    "Ready?"    
    $ ft("Hello, I'm saying something!")
And also with a defined character (note that the "ft()" function receives two arguments here):

Code: Select all

define e = Character('Eileen', color="#c8ffc8")

# The game starts here.
label start:
    "Ready?"
    $ ft("And I'm Eileen and I say something too!", e)
What do you think? Is it working for you?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Erthar
Newbie
Posts: 4
Joined: Wed May 08, 2013 5:58 pm
Contact:

Re: How do you make animated text?

#10 Post by Erthar »

That's a really nice effect, xavimat! I really like it. It works smoothly and without problems. I might use this. Thanks xavimat!

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: How do you make animated text?

#11 Post by xavimat »

Erthar wrote:That's a really nice effect, xavimat! I really like it. It works smoothly and without problems. I might use this. Thanks xavimat!
You're welcome. Glad to be helpful.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Outer
Regular
Posts: 32
Joined: Sat Sep 03, 2016 9:29 am
Contact:

Re: How do you make animated text?

#12 Post by Outer »

Hello! I am newbie and I want to achieve the same dialogue/nvl effect - (gif - https://imgur.com/CRMpNjp)
Can this effect be achieved in a similar way? How can I do that? I searched for a long time, but didn't find the necessary information.

Post Reply

Who is online

Users browsing this forum: thelastsecret