Page 1 of 1
How do you make animated text?
Posted: Wed May 08, 2013 6:13 pm
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.
Re: How do you make animated text?
Posted: Wed May 08, 2013 7:34 pm
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.
Re: How do you make animated text?
Posted: Wed May 08, 2013 9:47 pm
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.
Re: How do you make animated text?
Posted: Thu May 09, 2013 3:57 pm
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.
Re: How do you make animated text?
Posted: Thu May 09, 2013 7:07 pm
by Nuxill
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.
Re: How do you make animated text?
Posted: Thu May 09, 2013 7:13 pm
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
Re: How do you make animated text?
Posted: Thu May 09, 2013 8:49 pm
by Erthar
Thanks apricotorange! That's exactly what I want! And thank you Nuxill for your time!
Re: How do you make animated text?
Posted: Fri May 10, 2013 5:21 am
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."
Re: How do you make animated text?
Posted: Fri May 10, 2013 9:12 am
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?
Re: How do you make animated text?
Posted: Fri May 10, 2013 4:17 pm
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!
Re: How do you make animated text?
Posted: Fri May 10, 2013 5:02 pm
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.
Re: How do you make animated text?
Posted: Mon Aug 05, 2019 11:21 am
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.