Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create scrolling digital typewriter text

New Here ,
Jul 25, 2024 Jul 25, 2024

I’m trying to create a typewriter effect, where text appears letter by letter, and whenever an end of line is reached, it the text scrolls one line upwards.

 

It needs to be moving in sync with the audio, so I need to be able to add pauses and holds. 

I have inherited a project where this has been done in an incredibly complicated way, but I'm wondering if there might be a plug in or some code that could help??

 

Thanks in advance

TOPICS
How to
429
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 25, 2024 Jul 25, 2024

Maybe using 2 expressions and 2 slider controls:

 

source text:

spd = effect("TypeWrite Speed")(1);
text.sourceText.substr(0, time * spd)

 

position:

lineHeight = effect("Line Height")(1);
[value[0], value[1] - (text.sourceText.split('\r').length -1) * lineHeight]

 

screenshot.png

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 26, 2024 Jul 26, 2024
LATEST

I probably missed the most important feature:
the ability to pause and play the animation.
You might want to add a checkbox control ("Pause / Play") for this function.

 

source text expression:

spd = effect("TypeWrite Speed")(1);
s = effect("Pause / Play")(1);
t = time;

if (s.numKeys) {
  key = s.nearestKey(time).index;
  if (time < s.key(key).time) key--;
  
  if (key) {
    pause = 0;
    for (var i = 2; i <= key; i += 2) {
      pause += s.key(i).time - s.key(i - 1).time;
    }
    t = key % 2 === 1 ? s.key(key).time - pause : t - pause;
  }
}

text.sourceText.substr(0, t * spd);

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines