How to code 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
Jadenday
Newbie
Posts: 24
Joined: Fri Apr 25, 2014 1:18 pm
Projects: Yandere wa do yu imi deka?!
Contact:

How to code animated text?

#1 Post by Jadenday »

Hey everyone!

I was wondering if anyone could help me how to code animated text in Ren'py. By this I mean that little fadding text animation in almost EVERY visual novel. I saw two other topics but the answers where very vague and didn't explain anything in detail. If you could help, it would make my day! ^-^ thank you!

User avatar
ArachneJericho
Regular
Posts: 196
Joined: Sun Jun 22, 2014 2:04 am
Projects: Kaguya Hime
Tumblr: mousedeerproductions
Location: Seattle, WA, USA
Contact:

Re: How to code animated text?

#2 Post by ArachneJericho »

Do you mean, like how text fades in and then fades out? I'm otherwise confused by what you're asking about.

Jadenday
Newbie
Posts: 24
Joined: Fri Apr 25, 2014 1:18 pm
Projects: Yandere wa do yu imi deka?!
Contact:

Re: How to code animated text?

#3 Post by Jadenday »

ArachneJericho wrote:Do you mean, like how text fades in and then fades out? I'm otherwise confused by what you're asking about.
Like, if you play some of the mainstream visual novels or games that have visual novel aspects, the text would fade in letter by letter until the sentence is finished and visible.

User avatar
ArachneJericho
Regular
Posts: 196
Joined: Sun Jun 22, 2014 2:04 am
Projects: Kaguya Hime
Tumblr: mousedeerproductions
Location: Seattle, WA, USA
Contact:

Re: How to code animated text?

#4 Post by ArachneJericho »

Do you mean like titles or do you mean like sentences? Because the last one happens automatically when you set the CPS to something slower than instant (which it's set to by default in renpy).

Go to the preferences setting and set text speed. If you want the text speed to be slower by default on new installs, or after you delete persistent data, see options.rpy

User avatar
yon
Regular
Posts: 174
Joined: Tue Sep 09, 2014 5:09 pm
Projects: YDSP
Soundcloud: tetra-yon
itch: v-ual
Location: United States
Contact:

Re: How to code animated text?

#5 Post by yon »

If you want to have the sentence "typed out" for the player, go into options.rpy and look for this:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 0
Now, this makes it so the entire sentence is shown at once. It's fast, but it is somewhat lacking in aesthetics.
Here's the speed I'm happy with:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 30
Like the other user said, make sure to delete your persistent data so it takes effect.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How to code animated text?

#6 Post by philat »

You can also set the speed for each character separately.

Code: Select all

define e = Character("Eileen", what_slow_speed=30)
Unfortunately, I don't believe there's a way to fade in each character as it is typed out -- AFAIK, Renpy treats the whole block of text as one displayable, and any attempts to use transitions on the text will only happen once on the whole block, rather than on every last character that is showing up.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: How to code animated text?

#7 Post by Donmai »

Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Jadenday
Newbie
Posts: 24
Joined: Fri Apr 25, 2014 1:18 pm
Projects: Yandere wa do yu imi deka?!
Contact:

Re: How to code animated text?

#8 Post by Jadenday »

yon wrote:If you want to have the sentence "typed out" for the player, go into options.rpy and look for this:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 0
Now, this makes it so the entire sentence is shown at once. It's fast, but it is somewhat lacking in aesthetics.
Here's the speed I'm happy with:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 30
Like the other user said, make sure to delete your persistent data so it takes effect.

I did this and theirs no animation to it. when i click on the text it just pops as a whole sentence like it was before.

Jadenday
Newbie
Posts: 24
Joined: Fri Apr 25, 2014 1:18 pm
Projects: Yandere wa do yu imi deka?!
Contact:

Re: How to code animated text?

#9 Post by Jadenday »

philat wrote:You can also set the speed for each character separately.

Code: Select all

define e = Character("Eileen", what_slow_speed=30)
Unfortunately, I don't believe there's a way to fade in each character as it is typed out -- AFAIK, Renpy treats the whole block of text as one displayable, and any attempts to use transitions on the text will only happen once on the whole block, rather than on every last character that is showing up.

THAT IS EXACTLY WHAT I WANTED!! THANK YOU SO MUCH!! :D

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 to code animated text?

#10 Post by xavimat »

Jadenday wrote:
yon wrote:If you want to have the sentence "typed out" for the player, go into options.rpy and look for this:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 0
Now, this makes it so the entire sentence is shown at once. It's fast, but it is somewhat lacking in aesthetics.
Here's the speed I'm happy with:

Code: Select all

    ## The default text speed in characters per second. 0 is infinite.

    config.default_text_cps = 30
Like the other user said, make sure to delete your persistent data so it takes effect.

I did this and theirs no animation to it. when i click on the text it just pops as a whole sentence like it was before.
Maybe you missed that part?
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
TofuPancake
Newbie
Posts: 2
Joined: Sat Nov 29, 2014 3:35 am
Contact:

Re: How to code animated text?

#11 Post by TofuPancake »

You all are saying to delete persistent data but what exactly am I suppose to delete? xD;;;;

According to this:

Code: Select all

    #########################################
    ## This is the name of the directory where the game's data is
    ## stored. (It needs to be set early, before any other init code
    ## is run, so the persistent information can be found by the init code.)
python early:
    config.save_directory = "Project-1417243325"
init -1 python hide:
    #########################################
    ## Default values of Preferences.
    ## Note: These options are only evaluated the first time a
    ## game is run. To have them run a second time, delete
    ## game/saves/persistent
    ## Should we start in fullscreen mode?
    config.default_fullscreen = False
    ## The default text speed in characters per second. 0 is infinite.
    config.default_text_cps = 30
    ## The default auto-forward time setting.
    config.default_afm_time = 10
    #########################################
    ## More customizations can go here.
I don't understand how deleting this would prove helpful? The cps is in the persistent data portion. (I'm not sure how fullscreen stuff would effect typing, and the other one I put a hashtag in front of, and it didn't effect my text's typing.)


THIS works great: define e = Character("Eileen", what_slow_speed=30)
Except for the lines where I don't have a defined character..... OTL

Edit: I did a search for init instead of persistent, and I still have no clue what init data's I should remove xD (I'm guessing the final line is saying everything labeled init is persistent)

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 to code animated text?

#12 Post by xavimat »

You are right. We thought that you knew how to do it.
Maybe this is clearer:
renpy_delete_persistent.jpg
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
TofuPancake
Newbie
Posts: 2
Joined: Sat Nov 29, 2014 3:35 am
Contact:

Re: How to code animated text?

#13 Post by TofuPancake »

Oh okay thanks for the quick response! That helped a lot!~ xD ahahah
I didn't really read anything in the "Navigator Script" portion (I never read that menu heading before. xD;) of that menu so when people are bringing up scripts, it's like "deleting persistent data must be related to something within one of the scripts {in the edit section}!", never crossed my mind to look on the main menu honestly.
(Though for me I guess I might've realized to look there it if I hadn't accidentally read this "after you delete persistent data, see options.rpy" as "Delete persistent data in options.rpy")

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How to code animated text?

#14 Post by philat »

TofuPancake wrote:THIS works great: define e = Character("Eileen", what_slow_speed=30)
Except for the lines where I don't have a defined character..... OTL
Unrelated to the question at hand, but I assume you mean narration? Renpy's narration is handled by "narrator", which is just another character that happens to be predefined in the engine. You can override the default behavior of narrator like so (just a bunch of examples).

Code: Select all

define narrator = Character(None, color="#f00", ctc="ctc_fixed_blink", ctc_position="fixed", what_slow_speed=30)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]